Permalink
Browse files

Panel: Unbind link listeners when destroying a panel. Fixes #6309.

  • Loading branch information...
jaspermdegroot committed Aug 8, 2013
1 parent 60df261 commit 5909bfbe7247b838a04f2d37761ee095c7a09b92
Showing with 6 additions and 1 deletion.
  1. +6 −1 js/widgets/panel.js
View
@@ -219,7 +219,7 @@ $.widget( "mobile.panel", {
_bindLinkListeners: function() {
var self = this;
$.mobile.document.on( "click.panel" , "a", function( e ) {
$.mobile.document.on( "click.panel", "a", function( e ) {
if ( this.href.split( "#" )[ 1 ] === self._panelID && self._panelID !== undefined ) {
e.preventDefault();
var link = $( this );
@@ -488,6 +488,11 @@ $.widget( "mobile.panel", {
.off( this._transitionEndEvents )
.removeClass( [ this.options.classes.panelUnfixed, this.options.classes.panelClosed, this.options.classes.panelOpen ].join( " " ) );
$.mobile.document.off( this._transitionEndEvents );
if ( !multiplePanels ) {
$.mobile.document.off( "click.panel", "a" );
}
}
});

0 comments on commit 5909bfb

Please sign in to comment.