jenkins-bot has submitted this change and it was merged.

Change subject: Improved toolbarcontroller's event namespace assignment
......................................................................


Improved toolbarcontroller's event namespace assignment

Change-Id: Ic45a1162576fef3dbdb82e1427fbdd1977f8fa48
---
M lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js 
b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js
index 2513e99..30d6416 100644
--- a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js
+++ b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js
@@ -94,9 +94,11 @@
                                                // handler attached multiple 
times. This cannot be done along with
                                                // re-attaching the handlers 
since multiple event handlers may be registered
                                                // for the same event.
+                                               // The namespace needs to be 
very specific since instances of the the same
+                                               // toolbar may listen to the 
same event(s) on the same node.
                                                $.each( def.events, function( 
eventNames, callbackOrKeyword ) {
                                                        var namespacedEvents = 
assignNamespaces(
-                                                               eventNames, 
[self.widgetName, self.widgetName + type]
+                                                               eventNames, 
[self.widgetName, self.widgetName + type + id]
                                                        );
                                                        $initNode.off( 
namespacedEvents );
                                                } );
@@ -107,7 +109,7 @@
                                                        var callback =
                                                                
defaultCallbacks[ callbackOrKeyword ] || callbackOrKeyword,
                                                                
namespacedEvents = assignNamespaces(
-                                                                       
eventNames, [self.widgetName, self.widgetName + type]
+                                                                       
eventNames, [self.widgetName, self.widgetName + type + id]
                                                                );
 
                                                        if( !$.isFunction( 
callback ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/88994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic45a1162576fef3dbdb82e1427fbdd1977f8fa48
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to