mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 06:15:48 +08:00
FIX: Restrict editing queued posts to one at a time
This commit is contained in:
parent
c7d367996a
commit
e83bf7dc07
|
@ -13,27 +13,28 @@ function updateState(state) {
|
||||||
export default Ember.Controller.extend(BufferedContent, {
|
export default Ember.Controller.extend(BufferedContent, {
|
||||||
needs: ['queued-posts'],
|
needs: ['queued-posts'],
|
||||||
post: Ember.computed.alias('model'),
|
post: Ember.computed.alias('model'),
|
||||||
|
currentlyEditing: Ember.computed.alias('controllers.queued-posts.editing'),
|
||||||
|
|
||||||
editing: false,
|
editing: Discourse.computed.propertyEqual('model', 'currentlyEditing'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
approve: updateState('approved'),
|
approve: updateState('approved'),
|
||||||
reject: updateState('rejected'),
|
reject: updateState('rejected'),
|
||||||
|
|
||||||
edit() {
|
edit() {
|
||||||
this.set('editing', true);
|
this.set('currentlyEditing', this.get('model'));
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmEdit() {
|
confirmEdit() {
|
||||||
this.get('post').update({ raw: this.get('buffered.raw') }).then(() => {
|
this.get('post').update({ raw: this.get('buffered.raw') }).then(() => {
|
||||||
this.commitBuffer();
|
this.commitBuffer();
|
||||||
this.set('editing', false);
|
this.set('currentlyEditing', null);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelEdit() {
|
cancelEdit() {
|
||||||
this.rollbackBuffer();
|
this.rollbackBuffer();
|
||||||
this.set('editing', false);
|
this.set('currentlyEditing', null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user