1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

Extend list widget to pass refreshes to the story view

This commit is contained in:
Jermolene 2015-02-23 11:17:00 +01:00
parent 60e6b584bf
commit 0da1f3f554

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
*/
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
if(changedAttributes.filter || changedAttributes.template || changedAttributes.editTemplate || changedAttributes.emptyMessage || changedAttributes.storyview || changedAttributes.history) {
this.refreshSelf();
return true;
result = true;
} else {
// Handle any changes to the list
var hasChanged = this.handleListChanges(changedTiddlers);
result = this.handleListChanges(changedTiddlers);
// Handle any changes to the history stack
if(this.historyTitle && changedTiddlers[this.historyTitle]) {
this.handleHistoryChanges();
}
return hasChanged;
}
// Call the storyview
if(this.storyview && this.storyview.refreshEnd) {
this.storyview.refreshEnd(changedTiddlers,changedAttributes);
}
return result;
};
/*