From 3bebc6287375d6333cf8e2ef9ef714eb81efb741 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sun, 2 Nov 2014 14:59:23 -0500 Subject: [PATCH] blocked empty topic creation with message to add title --- app/assets/javascripts/src/Metamaps.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 2b2af1b5..11594a0a 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -701,6 +701,7 @@ Metamaps.Create = { $('#topic_name').focus(); }); Metamaps.Create.newTopic.beingCreated = true; + Metamaps.Create.newTopic.name = ""; }, hide: function () { $('#new_topic').fadeOut('fast'); @@ -3619,6 +3620,11 @@ Metamaps.Topic = { createTopicLocally: function () { var self = Metamaps.Topic; + if (Metamaps.Create.newTopic.name === "") { + Metamaps.GlobalUI.notifyUser("Please enter a topic title..."); + return; + } + $(document).trigger(Metamaps.Map.events.editedByActiveMapper); var metacode = Metamaps.Metacodes.get(Metamaps.Create.newTopic.metacode);