Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Panel: Unbind link listeners when destroying a panel. Fixes #6309.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Aug 12, 2013
1 parent 60df261 commit 5909bfb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/widgets/panel.js
Expand Up @@ -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 );
Expand Down Expand Up @@ -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" );
}

}
});

Expand Down

0 comments on commit 5909bfb

Please sign in to comment.