Skip to content

Commit

Permalink
Change permalink behaviour
Browse files Browse the repository at this point in the history
Now a link to a single tiddler like http://tiddlywiki.com/#HelloThere
will just open that single tiddler (the old behaviour was to also open
the default tiddlers)
  • Loading branch information
Jermolene committed May 28, 2014
1 parent 62c602e commit f7b8813
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/modules/startup/story.js
Expand Up @@ -63,7 +63,7 @@ function openStartupTiddlers(options) {
options = options || {};
// Decode the hash portion of our URL
var target,
storyFilter;
storyFilter = null;
if($tw.locationHash.length > 1) {
var hash = $tw.locationHash.substr(1),
split = hash.indexOf(":");
Expand All @@ -74,13 +74,13 @@ function openStartupTiddlers(options) {
storyFilter = decodeURIComponent(hash.substr(split + 1).trim());
}
}
// Use the story filter specified in the hash, or the default tiddlers
if(!storyFilter || storyFilter === "") {
// If the story wasn't specified use the current tiddlers or a blank story
if(storyFilter === null) {
if(options.defaultToCurrentStory) {
var currStoryList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE);
storyFilter = $tw.utils.stringifyList(currStoryList);
} else {
storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);
storyFilter = "";
}
}
var storyList = $tw.wiki.filterTiddlers(storyFilter);
Expand Down

0 comments on commit f7b8813

Please sign in to comment.