Ghost/ghost/admin/app/controllers/posts.js
Austin Burdine bfe542b27d more shimming of controllers (#110)
refs #101, #95
- shim controllers that were missed initially
2016-07-06 20:47:30 +01:00

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');
}
}
});