From c509053bc13f7e2ca15e610a27f1df4fa954d1aa Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 26 Jun 2012 20:50:29 +0100 Subject: [PATCH] Mending the zoomin effect Navigating forwards works OK --- core/modules/macros/navigator.js | 8 +++++-- core/modules/macros/story/story.js | 4 ++-- core/modules/macros/story/views/classic.js | 4 ++-- core/modules/macros/story/views/zoomin.js | 25 ++++--------------- core/modules/treenodes/node.js | 28 +++++++++++++++++++++- 5 files changed, 42 insertions(+), 27 deletions(-) diff --git a/core/modules/macros/navigator.js b/core/modules/macros/navigator.js index 57d617495..b48a9a1f2 100644 --- a/core/modules/macros/navigator.js +++ b/core/modules/macros/navigator.js @@ -97,9 +97,13 @@ exports.eventMap["tw-navigate"] = function(event) { if(this.hasParameter("set")) { this.wiki.setTextReference(this.params.set,event.navigateTo); } - // Add the tiddler to the top of the history stack + // Add a new record to the top of the history stack this.getHistory(); - this.history.stack.push({title: event.navigateTo}); + this.history.stack.push({ + title: event.navigateTo, + fromTitle: event.navigateFromTitle, + fromPosition: event.navigateFrom.getNodeBounds() + }); this.saveHistory(); event.stopPropagation(); return false; diff --git a/core/modules/macros/story/story.js b/core/modules/macros/story/story.js index cd9cc9d10..f89f7ddaa 100644 --- a/core/modules/macros/story/story.js +++ b/core/modules/macros/story/story.js @@ -291,14 +291,14 @@ exports.processHistoryChange = function() { for(t=this.prevHistory.stack.length-1; t>=topCommon; t--) { index = this.findStoryElementByTitle(0,this.prevHistory.stack[t].title); if(index !== undefined && this.storyview.navigateBack) { - this.storyview.navigateBack(this.storyNode.children[index]); + this.storyview.navigateBack(this.storyNode.children[index],this.history.stack[t]); } } // And now we navigate forwards through the new history to get to the latest tiddler for(t=topCommon; t