From d5c31ed07f31164cb2c2739ea56e7708fc39e9a4 Mon Sep 17 00:00:00 2001 From: Skeeve Date: Fri, 21 Feb 2014 10:37:20 +0100 Subject: [PATCH] Update navigator.js As described here: https://groups.google.com/d/msg/tiddlywikidev/AWvXz7RMIC4/gFF5crN2UJoJ Providing a name for the new tiddler message only works if a skeleton tiddler already exists. If not, "New Tiddler" is taken. This change fixes that in that the provided name is taken even if there is no skeleton. --- core/modules/widgets/navigator.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 598026ffe..56373bcbd 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -323,10 +323,11 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) { NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { // Get the story details var storyList = this.getStoryList(); + var newTiddlerTitle = event.param || "New Tiddler"; // Get the template tiddler if there is one - var templateTiddler = this.wiki.getTiddler(event.param); + var templateTiddler = this.wiki.getTiddler(newTiddlerTitle); // Create the new tiddler - var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler"); + var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || newTiddlerTitle); var tiddler = new $tw.Tiddler(this.wiki.getCreationFields(),{ text: "Newly created tiddler", title: title