1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-15 23:07:18 +00:00

Add support for full refreshing of action widgets

Fixes #5791
This commit is contained in:
jeremy@jermolene.com
2021-07-02 14:33:38 +01:00
parent f87b3bfcdb
commit 3094e06236
2 changed files with 53 additions and 7 deletions

View File

@@ -568,10 +568,15 @@ Widget.prototype.invokeActions = function(triggeringWidget,event) {
var handled = false;
// For each child widget
for(var t=0; t<this.children.length; t++) {
var child = this.children[t];
// Invoke the child if it is an action widget
if(child.invokeAction) {
var child = this.children[t],
childIsActionWidget = !!child.invokeAction,
actionRefreshPolicy = child.getVariable("tv-action-refresh-policy");
// Refresh the child if required
if(childIsActionWidget || actionRefreshPolicy === "always") {
child.refreshSelf();
}
// Invoke the child if it is an action widget
if(childIsActionWidget) {
if(child.invokeAction(triggeringWidget,event)) {
handled = true;
}