bootstrap_sb_admin_base_v2 icon indicating copy to clipboard operation
bootstrap_sb_admin_base_v2 copied to clipboard

sidebar navbar "active" option problem

Open cmerida79 opened this issue 7 years ago • 1 comments

Hi, When create item fail and the controller action render :new again I have active the index link option because of this: (in sb-admin-2.js)

var url = window.location; var element = $('ul.nav a').filter(function() { return this.href == url; }).addClass('active').parents('ul').addClass('in'); if (element.is('li')) { element.addClass('active'); }

the render :new set url without /new and the href checkin in js is true...

Regards,

Carlos

cmerida79 avatar Jun 04 '17 16:06 cmerida79

The problem is for the url params, with this, you can repair it.

var url = window.location; var element = $('ul.nav a').filter(function() {
return this.href == url.origin + url.pathname; }).addClass('active').parents('ul').addClass('in'); if (element.is('li')) { element.addClass('active'); } });

VicML avatar Dec 05 '17 21:12 VicML