Add new navigation item on enter key

No Issue
- Fix regression in add item on enter behavior.
This commit is contained in:
Jason Williams 2015-01-27 23:14:45 +00:00
parent 1ac1f7880a
commit b3ed3d78cb

View File

@ -58,8 +58,23 @@ var NavItemUrlInputComponent = Ember.TextField.extend({
}
},
keyPress: function (event) {
// enter key
if (event.keyCode === 13) {
event.preventDefault();
this.notifyUrlChanged();
}
return true;
},
focusOut: function () {
this.set('hasFocus', false);
this.notifyUrlChanged();
},
notifyUrlChanged: function () {
this.set('value', this.get('value').trim());
var url = this.get('value'),