Daniel Werner has submitted this change and it was merged. Change subject: JavaScript event handler management optimization ......................................................................
JavaScript event handler management optimization Taking care of event handlers getting removed properly. Change-Id: I2e6481812e69734d4eb5e43c48d6f556e0535657 --- M ValueView/resources/jquery.ui/jquery.ui.listrotator.js M ValueView/resources/jquery.ui/jquery.ui.toggler.js 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Daniel Werner: Checked; Looks good to me, approved diff --git a/ValueView/resources/jquery.ui/jquery.ui.listrotator.js b/ValueView/resources/jquery.ui/jquery.ui.listrotator.js index dc37c23..4a562aa 100644 --- a/ValueView/resources/jquery.ui/jquery.ui.listrotator.js +++ b/ValueView/resources/jquery.ui/jquery.ui.listrotator.js @@ -216,7 +216,7 @@ // Attach event to html node to detect click outside of the menu closing the menu: $( 'html' ) .off( '.' + this.widgetName ) - .on( 'click.' + this.widgetBaseClass, function( event ) { + .on( 'click.' + this.widgetName, function( event ) { $( ':' + self.widgetBaseClass ).each( function( i, node ) { var $target = $( event.target ), listrotator = $( node ).data( 'listrotator' ); diff --git a/ValueView/resources/jquery.ui/jquery.ui.toggler.js b/ValueView/resources/jquery.ui/jquery.ui.toggler.js index 88b5180..a4b20f8 100644 --- a/ValueView/resources/jquery.ui/jquery.ui.toggler.js +++ b/ValueView/resources/jquery.ui/jquery.ui.toggler.js @@ -106,7 +106,7 @@ .addClass( this.widgetBaseClass + '-icon ui-icon' ); this.element - .on( 'click', function( event ) { + .on( 'click.' + this.widgetName, function( event ) { if( !self.element.hasClass( 'ui-state-disabled' ) ) { // Change toggle icon to reflect current state of toggle subject visibility: self._reflectVisibilityOnToggleIcon( true ); @@ -117,10 +117,10 @@ } ); } } ) - .on( 'mouseover', function( event ) { + .on( 'mouseover.' + this.widgetName, function( event ) { self.element.addClass( 'ui-state-hover' ); } ) - .on( 'mouseout', function( event ) { + .on( 'mouseout.' + this.widgetName, function( event ) { self.element.removeClass( 'ui-state-hover' ); } ) .append( this.$toggleIcon ) -- To view, visit https://gerrit.wikimedia.org/r/73397 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e6481812e69734d4eb5e43c48d6f556e0535657 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de> Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits