mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Add new navigation item on enter key
No Issue - Fix regression in add item on enter behavior.
This commit is contained in:
parent
1ac1f7880a
commit
b3ed3d78cb
@ -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'),
|
||||
|
Loading…
Reference in New Issue
Block a user