From 4777ef8d6ae94a139d94c4fb3aaf8f30f94d3ce8 Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Fri, 3 May 2013 14:31:15 +0200 Subject: [PATCH] Panel: Make sure active button class is removed when link to panel is a listview button. Fixes #5961. --- js/widgets/panel.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/widgets/panel.js b/js/widgets/panel.js index 9beadddc3de..a7c046f7901 100644 --- a/js/widgets/panel.js +++ b/js/widgets/panel.js @@ -223,6 +223,11 @@ $.widget( "mobile.panel", $.mobile.widget, { e.preventDefault(); var $link = $( this ); if ( ! $link.hasClass( "ui-link" ) ) { + // Check if we are in a listview + var $parent = $link.parent().parent(); + if ( $parent.hasClass( "ui-li" ) ) { + $link = $parent.parent(); + } $link.addClass( $.mobile.activeBtnClass ); self.element.one( "panelopen panelclose", function() { $link.removeClass( $.mobile.activeBtnClass );