Ghost/ghost/admin/app/components/gh-navitem.js
John O'Nolan 79f90c1d27 Refactor blog-navigation settings screen
- Better markup
- Cleaner CSS
- Fixed icon implementation
- New grab handle icon
- Better mobile styles
2015-05-25 14:23:49 +01:00

32 lines
765 B
JavaScript

import Ember from 'ember';
var NavItemComponent = Ember.Component.extend({
classNames: 'gh-blognav-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;