1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Merge pull request #423 from Skeeve/patch-3

Update navigator.js
This commit is contained in:
Jeremy Ruston 2014-02-21 09:40:16 +00:00
commit d4baf515ed

View File

@ -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