mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-21 10:13:18 +00:00
parent
207406eeb3
commit
a1ce254e95
@ -43,6 +43,15 @@ SetWidget.prototype.execute = function() {
|
||||
this.setValue = this.getAttribute("value");
|
||||
this.setEmptyValue = this.getAttribute("emptyValue");
|
||||
// Set context variable
|
||||
this.setVariable(this.setName,this.getValue(),this.parseTreeNode.params);
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Get the value to be assigned
|
||||
*/
|
||||
SetWidget.prototype.getValue = function() {
|
||||
var value = this.setValue;
|
||||
if(this.setFilter) {
|
||||
var results = this.wiki.filterTiddlers(this.setFilter,this);
|
||||
@ -53,9 +62,7 @@ SetWidget.prototype.execute = function() {
|
||||
value = this.setEmptyValue;
|
||||
}
|
||||
}
|
||||
this.setVariable(this.setName,value,this.parseTreeNode.params);
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
return value;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -63,11 +70,12 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
SetWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.name || changedAttributes.filter || changedAttributes.value || changedAttributes.emptyValue) {
|
||||
if(changedAttributes.name || changedAttributes.filter || changedAttributes.value || changedAttributes.emptyValue ||
|
||||
(this.setFilter && this.getValue() != this.variables[this.setName].value)) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user