mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-04 15:11:41 +00:00
Fix data widget not refreshing
This commit is contained in:
@@ -134,10 +134,10 @@ DataWidget.prototype.extractCompoundTiddler = function(title) {
|
|||||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||||
*/
|
*/
|
||||||
DataWidget.prototype.refresh = function(changedTiddlers) {
|
DataWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
// Refresh our attributes
|
// It would be expensive to calculate whether the changedTiddlers impact the filter
|
||||||
var changedAttributes = this.computeAttributes();
|
// identified by the $filter attribute so we just refresh ourselves unconditionally
|
||||||
// Refresh our children, and indicate that we refreshed if any of our attribute values have changed
|
this.refreshSelf();
|
||||||
return this.refreshChildren(changedTiddlers) || $tw.utils.count(changedAttributes) > 0;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.data = DataWidget;
|
exports.data = DataWidget;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
title: TestCases/DataWidget/Refreshing
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
description: Refreshing the data widget
|
||||||
|
display-format: plaintext
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
<$data title="Epsilon" text={{Subject}}/>
|
||||||
|
+
|
||||||
|
title: Subject
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
+
|
||||||
|
title: Actions
|
||||||
|
|
||||||
|
<$action-setfield $tiddler="Subject" text="Theta"/>
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p>[
|
||||||
|
{
|
||||||
|
"title": "Epsilon",
|
||||||
|
"text": "Theta"
|
||||||
|
}
|
||||||
|
]</p>
|
||||||
Reference in New Issue
Block a user