1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-20 02:07:38 +00:00

Add support for action widgets

This is part of the groundwork for fixing #336
This commit is contained in:
Jermolene
2014-10-08 17:45:26 +01:00
parent 3b69b7b6e8
commit 0dcf54c3b5
11 changed files with 303 additions and 17 deletions

View File

@@ -475,6 +475,20 @@ Widget.prototype.removeChildDomNodes = function() {
}
};
/*
Invoke any action widgets that are immediate children of this widget
*/
Widget.prototype.invokeActions = function(event) {
var handled = false;
for(var t=0; t<this.children.length; t++) {
var child = this.children[t];
if(child.invokeAction && child.invokeAction(this,event)) {
handled = true;
}
}
return handled;
};
exports.widget = Widget;
})();