mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 01:20:30 +00:00
Merge pull request #1952 from tobibeer/1937-set-refresh-filter
fixes #1937 — filter refresh in set widget
This commit is contained in:
commit
b1633e0f2d
@ -43,6 +43,15 @@ SetWidget.prototype.execute = function() {
|
|||||||
this.setValue = this.getAttribute("value");
|
this.setValue = this.getAttribute("value");
|
||||||
this.setEmptyValue = this.getAttribute("emptyValue");
|
this.setEmptyValue = this.getAttribute("emptyValue");
|
||||||
// Set context variable
|
// 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;
|
var value = this.setValue;
|
||||||
if(this.setFilter) {
|
if(this.setFilter) {
|
||||||
var results = this.wiki.filterTiddlers(this.setFilter,this);
|
var results = this.wiki.filterTiddlers(this.setFilter,this);
|
||||||
@ -53,9 +62,7 @@ SetWidget.prototype.execute = function() {
|
|||||||
value = this.setEmptyValue;
|
value = this.setEmptyValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setVariable(this.setName,value,this.parseTreeNode.params);
|
return value;
|
||||||
// Construct the child widgets
|
|
||||||
this.makeChildWidgets();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -63,7 +70,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
*/
|
*/
|
||||||
SetWidget.prototype.refresh = function(changedTiddlers) {
|
SetWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
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();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user