From 05c3de3245fc8c629640ef86c4282fff05b076c6 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 23 Feb 2015 11:24:03 +0100 Subject: [PATCH] Extend list widget to invoke storyview for refreshes --- core/modules/widgets/list.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/modules/widgets/list.js b/core/modules/widgets/list.js index ed1998203..7244ee280 100755 --- a/core/modules/widgets/list.js +++ b/core/modules/widgets/list.js @@ -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; }; /*