Skip to content

Commit cf54b98

Browse files
Navbar: make sure nav buttons with href="#" still get active state.
This fixes a regression from the fix for jquery-archive#5707. That issue was a regression from the fix for jquery-archive#1181. I added the workaround for jquery-archive#1181 again but changed the event to avoid the regression.
1 parent 62c661e commit cf54b98

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/widgets/navbar.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ $.widget( "mobile.navbar", $.mobile.widget, {
4343

4444
if ( !target.is( ".ui-disabled, .ui-btn-active" ) ) {
4545
$navbtns.removeClass( $.mobile.activeBtnClass );
46-
target.addClass( $.mobile.activeBtnClass );
46+
$( this ).addClass( $.mobile.activeBtnClass );
47+
48+
// The code below is a workaround to fix #1181
49+
var activeBtn = $( this );
50+
51+
$( document ).one( "pagehide", function() {
52+
activeBtn.removeClass( $.mobile.activeBtnClass );
53+
});
4754
}
4855
});
4956

0 commit comments

Comments
 (0)