mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 18:10:27 +00:00
Fix bug with import tiddler handling
This commit is contained in:
parent
0a716ca0ef
commit
89989c737e
@ -415,7 +415,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
} catch(e) {
|
} catch(e) {
|
||||||
}
|
}
|
||||||
// Get the current $:/Import tiddler
|
// Get the current $:/Import tiddler
|
||||||
var importTiddler = this.wiki.getTiddler(IMPORT_TITLE) || {fields: {}},
|
var importTiddler = this.wiki.getTiddler(IMPORT_TITLE),
|
||||||
importData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),
|
importData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),
|
||||||
newFields = new Object({
|
newFields = new Object({
|
||||||
title: IMPORT_TITLE,
|
title: IMPORT_TITLE,
|
||||||
@ -467,14 +467,14 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
//
|
//
|
||||||
NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
|
NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
|
||||||
var self = this,
|
var self = this,
|
||||||
importTiddler = this.wiki.getTiddler(event.param) || {fields: {}},
|
importTiddler = this.wiki.getTiddler(event.param),
|
||||||
importData = this.wiki.getTiddlerData(event.param,{tiddlers: {}}),
|
importData = this.wiki.getTiddlerData(event.param,{tiddlers: {}}),
|
||||||
importReport = [];
|
importReport = [];
|
||||||
// Add the tiddlers to the store
|
// Add the tiddlers to the store
|
||||||
importReport.push("The following tiddlers were imported:\n");
|
importReport.push("The following tiddlers were imported:\n");
|
||||||
$tw.utils.each(importData.tiddlers,function(tiddlerFields) {
|
$tw.utils.each(importData.tiddlers,function(tiddlerFields) {
|
||||||
var title = tiddlerFields.title;
|
var title = tiddlerFields.title;
|
||||||
if(title && importTiddler.fields["selection-" + title] !== "unchecked") {
|
if(title && importTiddler && importTiddler.fields["selection-" + title] !== "unchecked") {
|
||||||
self.wiki.addTiddler(new $tw.Tiddler(tiddlerFields));
|
self.wiki.addTiddler(new $tw.Tiddler(tiddlerFields));
|
||||||
importReport.push("# [[" + tiddlerFields.title + "]]");
|
importReport.push("# [[" + tiddlerFields.title + "]]");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user