mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 08:54:36 +03:00
fb239054a0
follow up from #95 - converts components to use ember-cli-shims
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import Component from 'ember-component';
|
|
import {htmlSafe} from 'ember-string';
|
|
import injectService from 'ember-service/inject';
|
|
import computed from 'ember-computed';
|
|
|
|
export default Component.extend({
|
|
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 htmlSafe(`background-image: url(${url})`);
|
|
}),
|
|
|
|
config: injectService(),
|
|
session: injectService(),
|
|
ghostPaths: injectService(),
|
|
feature: injectService(),
|
|
|
|
mouseEnter() {
|
|
this.sendAction('onMouseEnter');
|
|
},
|
|
|
|
actions: {
|
|
toggleAutoNav() {
|
|
this.sendAction('toggleMaximise');
|
|
},
|
|
|
|
showMarkdownHelp() {
|
|
this.sendAction('showMarkdownHelp');
|
|
},
|
|
|
|
closeMobileMenu() {
|
|
this.sendAction('closeMobileMenu');
|
|
},
|
|
|
|
openAutoNav() {
|
|
this.sendAction('openAutoNav');
|
|
}
|
|
}
|
|
});
|