mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Merge pull request #3569 from morficus/issue-3549
fix most recent post stolen by the last logged in user AND only show active users in post-settings-menu drop-down
This commit is contained in:
commit
89389b3673
1 changed files with 12 additions and 7 deletions
|
@ -13,7 +13,13 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
|
|||
this.addObserver('titleScratch', this, 'titleObserver');
|
||||
}
|
||||
},
|
||||
selectedAuthor: Ember.computed.oneWay('author'),
|
||||
selectedAuthor: Ember.computed(function () {
|
||||
var self = this;
|
||||
return this.get('author').then(function (author) {
|
||||
self.set('selectedAuthor', author);
|
||||
return author;
|
||||
});
|
||||
}),
|
||||
changeAuthor: function () {
|
||||
var author = this.get('author'),
|
||||
selectedAuthor = this.get('selectedAuthor'),
|
||||
|
@ -38,15 +44,14 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
|
|||
}.observes('selectedAuthor'),
|
||||
authors: function () {
|
||||
//Loaded asynchronously, so must use promise proxies.
|
||||
var deferred = {},
|
||||
self = this;
|
||||
var deferred = {};
|
||||
|
||||
deferred.promise = this.store.find('user').then(function (users) {
|
||||
return users.rejectBy('id', 'me');
|
||||
}).then(function (users) {
|
||||
self.set('selectedAuthor', users.get('firstObject'));
|
||||
|
||||
return users;
|
||||
return users.filter(function (user) {
|
||||
return user.get('active');
|
||||
});
|
||||
});
|
||||
|
||||
return Ember.ArrayProxy
|
||||
|
@ -249,4 +254,4 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
|
|||
}
|
||||
});
|
||||
|
||||
export default PostSettingsMenuController;
|
||||
export default PostSettingsMenuController;
|
||||
|
|
Loading…
Add table
Reference in a new issue