Changed name changing to not repeatedly ask for a name

This commit is contained in:
Tim Stallard 2017-04-05 17:06:47 +01:00
parent 03f7a99d1d
commit 3c2c02b984

View File

@ -22,10 +22,10 @@ $("#importUpload").change(function(){ //when a file is selected
}); });
$("#header a#projectName").click(function(){ $("#header a#projectName").click(function(){
do{ var newName = prompt("Please enter a name for the diagram", diagram.name);
diagram.name = prompt("Please enter a name for the diagram", diagram.name); if(newName){
diagram.name = newName;
} }
while(!diagram.name); //keep asking for a new name until a valid one is entered
$("#header a#projectName").html(diagram.name); $("#header a#projectName").html(diagram.name);
}); });