mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 11:30:55 +03:00
Merge pull request #4860 from jaswilli/add-on-enter
Add new navigation item on enter key
This commit is contained in:
commit
366ed7c220
@ -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