mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-07 19:13:00 +00:00
Allow widgets to choose not to propagate actions
Allow widgets to choose not to propagate actions. This is important for widgets that themselves trigger actions. Note that this change will cause problems with any existing 5.1.8-prerelease plugins that call `invokeActions()`.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user