blocked empty topic creation with message to add title

This commit is contained in:
Connor Turland 2014-11-02 14:59:23 -05:00
parent 7805871ec2
commit 3bebc62873

View file

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