Fix bug where a blank name could be set for a window

This commit is contained in:
Nick Krichevsky 2015-03-07 11:55:33 -05:00
parent 31fe03e038
commit 588ab6270e

View file

@ -125,7 +125,7 @@ function setupWindowElement(currentWindow,callback){
input.setAttribute('value',windowName.textContent);
input.addEventListener('keydown', function(event){
event.stopPropagation();
if(event.keyCode===13){
if(event.keyCode===13 && input.value.length>0){
event.preventDefault();
windowName.textContent = input.value;
input.parentNode.replaceChild(windowName,input);