Bug 34131: Add 'current' class on correct side menu link
This changes the way we're looking for the correct menu item to set as active. If we don't find an exact match for path+params, we attempt to set 'current' to just matching on path. What this does is it sets the 'Plugins' menu item as active, even if the url is 'plugins-home.pl?method=report Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit680bf6af2f) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commit919ba4ab3e) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
36650312a6
commit
04d21a63bb
|
|
@ -144,7 +144,11 @@ $(document).ready(function() {
|
|||
if ( url.match(/\?(.+)$/) ) {
|
||||
params = "?" + RegExp.$1;
|
||||
}
|
||||
$("a[href$=\"/" + path + params + "\"]", navmenulist).addClass("current");
|
||||
if ($("a[href$=\"/" + path + params + "\"]", navmenulist).length == 0){
|
||||
$("a[href$=\"/" + path + "\"]", navmenulist).addClass("current");
|
||||
} else {
|
||||
$("a[href$=\"/" + path + params + "\"]", navmenulist).addClass("current");
|
||||
}
|
||||
}
|
||||
|
||||
$("#catalog-search-link a").on("mouseenter mouseleave", function(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue