2015-05-24 08:47:23 +03:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
2016-01-19 16:03:27 +03:00
|
|
|
const {
|
|
|
|
Component,
|
2016-03-31 20:09:54 +03:00
|
|
|
inject: {service},
|
|
|
|
computed
|
2016-01-19 16:03:27 +03:00
|
|
|
} = Ember;
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
export default Component.extend({
|
2015-05-24 08:47:23 +03:00
|
|
|
tagName: 'nav',
|
|
|
|
classNames: ['gh-nav'],
|
|
|
|
classNameBindings: ['open'],
|
|
|
|
|
|
|
|
open: false,
|
|
|
|
|
2016-03-31 20:09:54 +03:00
|
|
|
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(),
|
2016-03-31 20:09:54 +03:00
|
|
|
ghostPaths: service(),
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
mouseEnter() {
|
2015-05-27 17:39:56 +03:00
|
|
|
this.sendAction('onMouseEnter');
|
2015-05-24 08:47:23 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2015-10-28 14:36:45 +03:00
|
|
|
toggleAutoNav() {
|
2015-06-13 17:34:09 +03:00
|
|
|
this.sendAction('toggleMaximise');
|
2015-05-24 08:47:23 +03:00
|
|
|
},
|
|
|
|
|
2015-11-18 13:50:48 +03:00
|
|
|
showMarkdownHelp() {
|
|
|
|
this.sendAction('showMarkdownHelp');
|
2015-06-09 19:25:45 +03:00
|
|
|
},
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
closeMobileMenu() {
|
2015-06-09 19:25:45 +03:00
|
|
|
this.sendAction('closeMobileMenu');
|
2015-09-02 15:04:06 +03:00
|
|
|
},
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
openAutoNav() {
|
2015-09-02 15:04:06 +03:00
|
|
|
this.sendAction('openAutoNav');
|
2015-05-24 08:47:23 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|