diff --git a/app/assets/javascripts/src/Metamaps.Import.js.erb b/app/assets/javascripts/src/Metamaps.Import.js.erb index d17077ae..14612247 100644 --- a/app/assets/javascripts/src/Metamaps.Import.js.erb +++ b/app/assets/javascripts/src/Metamaps.Import.js.erb @@ -22,7 +22,9 @@ Metamaps.Import = { var text = e.originalEvent.clipboardData.getData('text/plain'); var parsed = self.parseTabbedString(text); - if (confirm("Are you sure you want to create " + parsed.length + " new topics?")) { + if (parsed.length > 0 && + confirm("Are you sure you want to create " + parsed.length + + " new topics?")) { self.importTopics(parsed); }//if }); @@ -76,7 +78,8 @@ Metamaps.Import = { return results; }, - createTopicWithParameters: function(name, metacode_name, permission, desc, link, xloc, yloc) { + createTopicWithParameters: function(name, metacode_name, permission, desc, + link, xloc, yloc) { var self = Metamaps.Topic; var metacode = Metamaps.Metacodes.where({name: metacode_name})[0] || null; @@ -99,6 +102,7 @@ Metamaps.Import = { }); Metamaps.Mappings.add(mapping); - self.renderTopic(mapping, topic, true, true); // this function also includes the creation of the topic in the database + // this function also includes the creation of the topic in the database + self.renderTopic(mapping, topic, true, true); }, };