mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05: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
1 changed files with 15 additions and 0 deletions
|
@ -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 () {
|
focusOut: function () {
|
||||||
this.set('hasFocus', false);
|
this.set('hasFocus', false);
|
||||||
|
|
||||||
|
this.notifyUrlChanged();
|
||||||
|
},
|
||||||
|
|
||||||
|
notifyUrlChanged: function () {
|
||||||
this.set('value', this.get('value').trim());
|
this.set('value', this.get('value').trim());
|
||||||
|
|
||||||
var url = this.get('value'),
|
var url = this.get('value'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue