mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
32 lines
765 B
JavaScript
32 lines
765 B
JavaScript
import Ember from 'ember';
|
|
var NavItemComponent = Ember.Component.extend({
|
|
classNames: 'navigation-item',
|
|
|
|
attributeBindings: ['order:data-order'],
|
|
order: Ember.computed.readOnly('navItem.order'),
|
|
|
|
keyPress: function (event) {
|
|
// enter key
|
|
if (event.keyCode === 13) {
|
|
event.preventDefault();
|
|
this.get('controller').send('addItem');
|
|
}
|
|
},
|
|
|
|
actions: {
|
|
addItem: function () {
|
|
this.sendAction('addItem');
|
|
},
|
|
|
|
deleteItem: function (item) {
|
|
this.sendAction('deleteItem', item);
|
|
},
|
|
|
|
updateUrl: function (value) {
|
|
this.sendAction('updateUrl', value, this.get('navItem'));
|
|
}
|
|
}
|
|
});
|
|
|
|
export default NavItemComponent;
|