2014-02-27 08:45:45 +04:00
|
|
|
import Resolver from 'ember/resolver';
|
2014-03-03 00:12:06 +04:00
|
|
|
import initFixtures from 'ghost/fixtures/init';
|
2014-02-27 08:45:45 +04:00
|
|
|
|
|
|
|
var App = Ember.Application.extend({
|
2014-02-26 08:58:00 +04:00
|
|
|
/**
|
|
|
|
* These are debugging flags, they are useful during development
|
|
|
|
*/
|
|
|
|
LOG_ACTIVE_GENERATION: true,
|
|
|
|
LOG_MODULE_RESOLVER: true,
|
|
|
|
LOG_TRANSITIONS: true,
|
|
|
|
LOG_TRANSITIONS_INTERNAL: true,
|
|
|
|
LOG_VIEW_LOOKUPS: true,
|
2014-02-27 08:45:45 +04:00
|
|
|
modulePrefix: 'ghost', // TODO: loaded via config
|
|
|
|
Resolver: Resolver['default']
|
2014-02-26 08:58:00 +04:00
|
|
|
});
|
|
|
|
|
2014-03-03 00:12:06 +04:00
|
|
|
initFixtures();
|
2014-03-02 18:30:35 +04:00
|
|
|
|
|
|
|
// TODO move into ext/route.js
|
|
|
|
// needed to add body class depending on current route
|
|
|
|
Ember.Route.reopen({
|
|
|
|
activate: function () {
|
|
|
|
var cssClasses = this.get('classNames'),
|
|
|
|
rootElement = this.router.namespace.get('rootElement');
|
|
|
|
|
|
|
|
if (cssClasses) {
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
|
|
Ember.$(rootElement).addClass(cssClasses);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
deactivate: function () {
|
|
|
|
var cssClasses = this.get('classNames'),
|
|
|
|
rootElement = this.router.namespace.get('rootElement');
|
|
|
|
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
|
|
Ember.$(rootElement).removeClass(cssClasses);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-02-27 08:45:45 +04:00
|
|
|
export default App;
|