Re-render menu item after setting class to active

Force the browser to re-render the menu item, to update the link layout immediately
by recreting the content html.

fixes #7897
This commit is contained in:
Matthias Jentsch 2014-12-29 16:14:12 +01:00
parent 4cf8da4bb9
commit 3d07049fbf
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@
if ($outerMenu.size()) {
$outerMenu.addClass('active');
}
/*
Recreate the html content of the menu item to force the browser to update the layout, or else
the link would only be visible as active after another click or page reload in Gecko and WebKit.
fixes #7897
*/
$selectedMenu.html($selectedMenu.html());
} else {
// store menu state
var $menus = $('#menu li.active', el);