mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 13:29:56 +00:00
Update navigator widget to use wiki.generateNewTitle()
This commit is contained in:
parent
274c52005d
commit
8538d69dc1
@ -320,13 +320,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
||||
// Get the template tiddler if there is one
|
||||
var templateTiddler = this.wiki.getTiddler(event.param);
|
||||
// Create the new tiddler
|
||||
var baseTitle = (templateTiddler && templateTiddler.fields.title) || "New Tiddler",
|
||||
title;
|
||||
var t = 0,
|
||||
title = baseTitle;
|
||||
while (this.wiki.tiddlerExists(title)) {
|
||||
title = baseTitle + " " + (++t);
|
||||
}
|
||||
var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler");
|
||||
var tiddler = new $tw.Tiddler(this.wiki.getCreationFields(),{
|
||||
text: "Newly created tiddler",
|
||||
title: title
|
||||
|
Loading…
Reference in New Issue
Block a user