diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index ff4d116e4..de839977a 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -63,7 +63,7 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { // Add a click event handler domNode.addEventListener("click",function (event) { var handled = false; - if(self.invokeActions(event)) { + if(self.invokeActions(this,event)) { handled = true; } if(self.to) { @@ -94,6 +94,13 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { this.domNodes.push(domNode); }; +/* +We don't allow actions to propagate because we trigger actions ourselves +*/ +ButtonWidget.prototype.allowActionPropagation = function() { + return false; +}; + ButtonWidget.prototype.getBoundingClientRect = function() { return this.domNodes[0].getBoundingClientRect(); } diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index 26c3bece0..bbcf5b025 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -476,29 +476,30 @@ Widget.prototype.removeChildDomNodes = function() { }; /* -Invoke any action widgets that are descendants of this widget. +Invoke the action widgets that are descendents of the current widget. */ -Widget.prototype.invokeActions = function(event) { - return this.invokeActionCall(this,event); -}; - -/* -Recursively search through descendants, invoking all actions encountered. -*/ -Widget.prototype.invokeActionCall = function(here,event) { +Widget.prototype.invokeActions = function(triggeringWidget,event) { var handled = false; - for(var t=0; t