Ghost/core/client/app/components/gh-nav-menu.js

48 lines
962 B
JavaScript
Raw Normal View History

2015-05-24 08:47:23 +03:00
import Ember from 'ember';
2016-01-19 16:03:27 +03:00
const {
Component,
inject: {service},
computed
2016-01-19 16:03:27 +03:00
} = Ember;
export default Component.extend({
2015-05-24 08:47:23 +03:00
tagName: 'nav',
classNames: ['gh-nav'],
classNameBindings: ['open'],
open: false,
navMenuIcon: computed('ghostPaths.subdir', function () {
let url = `${this.get('ghostPaths.subdir')}/ghost/img/ghosticon.jpg`;
return Ember.String.htmlSafe(`background-image: url(${url})`);
}),
2016-01-19 16:03:27 +03:00
config: service(),
session: service(),
ghostPaths: service(),
mouseEnter() {
this.sendAction('onMouseEnter');
2015-05-24 08:47:23 +03:00
},
actions: {
toggleAutoNav() {
this.sendAction('toggleMaximise');
2015-05-24 08:47:23 +03:00
},
showMarkdownHelp() {
this.sendAction('showMarkdownHelp');
},
closeMobileMenu() {
this.sendAction('closeMobileMenu');
},
openAutoNav() {
this.sendAction('openAutoNav');
2015-05-24 08:47:23 +03:00
}
}
});