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

Commit 5909bfb

Browse files
Panel: Unbind link listeners when destroying a panel. Fixes #6309.
1 parent 60df261 commit 5909bfb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/widgets/panel.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ $.widget( "mobile.panel", {
219219
_bindLinkListeners: function() {
220220
var self = this;
221221

222-
$.mobile.document.on( "click.panel" , "a", function( e ) {
222+
$.mobile.document.on( "click.panel", "a", function( e ) {
223223
if ( this.href.split( "#" )[ 1 ] === self._panelID && self._panelID !== undefined ) {
224224
e.preventDefault();
225225
var link = $( this );
@@ -488,6 +488,11 @@ $.widget( "mobile.panel", {
488488
.off( this._transitionEndEvents )
489489
.removeClass( [ this.options.classes.panelUnfixed, this.options.classes.panelClosed, this.options.classes.panelOpen ].join( " " ) );
490490
$.mobile.document.off( this._transitionEndEvents );
491+
492+
if ( !multiplePanels ) {
493+
$.mobile.document.off( "click.panel", "a" );
494+
}
495+
491496
}
492497
});
493498

0 commit comments

Comments
 (0)