1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00

Extend list widget to invoke storyview for refreshes

This commit is contained in:
Jermolene 2015-02-23 11:24:03 +01:00
parent 950a86c7b7
commit 05c3de3245

View File

@ -126,20 +126,29 @@ ListWidget.prototype.makeItemTemplate = 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
*/ */
ListWidget.prototype.refresh = function(changedTiddlers) { ListWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(); var changedAttributes = this.computeAttributes(),
result;
// Call the storyview
if(this.storyview && this.storyview.refreshStart) {
this.storyview.refreshStart(changedTiddlers,changedAttributes);
}
// Completely refresh if any of our attributes have changed // Completely refresh if any of our attributes have changed
if(changedAttributes.filter || changedAttributes.template || changedAttributes.editTemplate || changedAttributes.emptyMessage || changedAttributes.storyview || changedAttributes.history) { if(changedAttributes.filter || changedAttributes.template || changedAttributes.editTemplate || changedAttributes.emptyMessage || changedAttributes.storyview || changedAttributes.history) {
this.refreshSelf(); this.refreshSelf();
return true; result = true;
} else { } else {
// Handle any changes to the list // Handle any changes to the list
var hasChanged = this.handleListChanges(changedTiddlers); result = this.handleListChanges(changedTiddlers);
// Handle any changes to the history stack // Handle any changes to the history stack
if(this.historyTitle && changedTiddlers[this.historyTitle]) { if(this.historyTitle && changedTiddlers[this.historyTitle]) {
this.handleHistoryChanges(); this.handleHistoryChanges();
} }
return hasChanged;
} }
// Call the storyview
if(this.storyview && this.storyview.refreshEnd) {
this.storyview.refreshEnd(changedTiddlers,changedAttributes);
}
return result;
}; };
/* /*