mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
47 lines
1.1 KiB
JavaScript
47 lines
1.1 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('config.blogUrl', function () {
|
|
let url = `${this.get('config.blogUrl')}/favicon.png`;
|
|
|
|
return htmlSafe(`background-image: url(${url})`);
|
|
}),
|
|
|
|
config: injectService(),
|
|
session: injectService(),
|
|
ghostPaths: injectService(),
|
|
feature: injectService(),
|
|
routing: injectService('-routing'),
|
|
|
|
mouseEnter() {
|
|
this.sendAction('onMouseEnter');
|
|
},
|
|
|
|
actions: {
|
|
toggleAutoNav() {
|
|
this.sendAction('toggleMaximise');
|
|
},
|
|
|
|
showMarkdownHelp() {
|
|
this.sendAction('showMarkdownHelp');
|
|
},
|
|
|
|
closeMobileMenu() {
|
|
this.sendAction('closeMobileMenu');
|
|
},
|
|
|
|
openAutoNav() {
|
|
this.sendAction('openAutoNav');
|
|
}
|
|
}
|
|
});
|