1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/controllers/application.js
Matt Enlow 3cc7493dc2 Ember 1.11.1
- remove `bind-attr` all over the place
2015-04-05 21:13:30 -06:00

32 lines
1 KiB
JavaScript

import Ember from 'ember';
var ApplicationController = Ember.Controller.extend({
// jscs: disable
hideNav: Ember.computed.match('currentPath', /(error|signin|signup|setup|forgotten|reset)/),
// jscs: enable
topNotificationCount: 0,
showGlobalMobileNav: false,
showSettingsMenu: false,
userImage: Ember.computed('session.user.image', function () {
return this.get('session.user.image') || this.get('ghostPaths.url').asset('/shared/img/user-image.png');
}),
userImageBackground: Ember.computed('userImage', function () {
return `background-image: url(${this.get('userImage')})`.htmlSafe();
}),
userImageAlt: Ember.computed('session.user.name', function () {
var name = this.get('session.user.name');
return (name) ? name + '\'s profile picture' : 'Profile picture';
}),
actions: {
topNotificationChange: function (count) {
this.set('topNotificationCount', count);
}
}
});
export default ApplicationController;