From 691e5719a4ff74a04d389bd126ba2a69e7651a2a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 10 Feb 2015 22:40:38 +0000 Subject: [PATCH] Avoid unnecessary scrolling at startup The main fix is removing the fallback navigation to the first tiddler in story.js. Also required is the fix to the startup behaviour of zoomin.js. Fixes #981 --- core/modules/startup/story.js | 2 -- core/modules/storyviews/zoomin.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index ec0202c1f..b8a92bc58 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -133,8 +133,6 @@ function openStartupTiddlers(options) { target = target.substr(2,target.length - 4); } $tw.wiki.addToHistory(target); - } else if(storyList.length > 0) { - $tw.wiki.addToHistory(storyList[0]); } } diff --git a/core/modules/storyviews/zoomin.js b/core/modules/storyviews/zoomin.js index 1a66bdf33..350b7fa2b 100644 --- a/core/modules/storyviews/zoomin.js +++ b/core/modules/storyviews/zoomin.js @@ -30,7 +30,7 @@ var ZoominListView = function(listWidget) { if(!(domNode instanceof Element)) { return; } - if(targetTiddler !== itemWidget.parseTreeNode.itemTitle || (!targetTiddler && index)) { + if((targetTiddler && targetTiddler !== itemWidget.parseTreeNode.itemTitle) || (!targetTiddler && index)) { domNode.style.display = "none"; } else { self.currentTiddlerDomNode = domNode;