mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
bfe542b27d
refs #101, #95 - shim controllers that were missed initially
27 lines
739 B
JavaScript
27 lines
739 B
JavaScript
import Ember from 'ember';
|
|
import Controller from 'ember-controller';
|
|
import computed, {equal} from 'ember-computed';
|
|
import injectService from 'ember-service/inject';
|
|
|
|
const {compare} = Ember;
|
|
|
|
export default Controller.extend({
|
|
feature: injectService(),
|
|
|
|
showDeletePostModal: false,
|
|
|
|
// See PostsRoute's shortcuts
|
|
postListFocused: equal('keyboardFocus', 'postList'),
|
|
postContentFocused: equal('keyboardFocus', 'postContent'),
|
|
|
|
sortedPosts: computed('model.@each.{status,publishedAtUTC,isNew,updatedAtUTC}', function () {
|
|
return this.get('model').toArray().sort(compare);
|
|
}),
|
|
|
|
actions: {
|
|
toggleDeletePostModal() {
|
|
this.toggleProperty('showDeletePostModal');
|
|
}
|
|
}
|
|
});
|