From 9aaa000d3fc21310404b260fed45ab3390af9afe Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 26 May 2014 22:56:28 +0100 Subject: [PATCH] Fixed default tiddler not appearing in zoomin view See https://groups.google.com/d/topic/tiddlywiki/c-z7f-h1CAo/discussion --- core/modules/startup/story.js | 18 ++++++++++-------- core/wiki/view.tid | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index 0acce749c..893dc96ec 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -74,14 +74,6 @@ function openStartupTiddlers(options) { storyFilter = decodeURIComponent(hash.substr(split + 1).trim()); } } - // If a target tiddler was specified add it to the history stack - if(target && target !== "") { - // The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present - if(target.indexOf("[[") === 0 && target.substr(-2) === "]]") { - target = target.substr(2,target.length - 4); - } - $tw.wiki.addToHistory(target); - } // Use the story filter specified in the hash, or the default tiddlers if(!storyFilter || storyFilter === "") { if(options.defaultToCurrentStory) { @@ -98,6 +90,16 @@ function openStartupTiddlers(options) { } // Save the story list $tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields()); + // If a target tiddler was specified add it to the history stack + if(target && target !== "") { + // The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present + if(target.indexOf("[[") === 0 && target.substr(-2) === "]]") { + target = target.substr(2,target.length - 4); + } + $tw.wiki.addToHistory(target); + } else if(storyList.length > 0) { + $tw.wiki.addToHistory(storyList[0]); + } } function updateLocationHash() { diff --git a/core/wiki/view.tid b/core/wiki/view.tid index 13fe4c5ff..c8e5b344b 100644 --- a/core/wiki/view.tid +++ b/core/wiki/view.tid @@ -1,3 +1,3 @@ title: $:/view -classic \ No newline at end of file +zoomin \ No newline at end of file