mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:51:22 +08:00
FIX: changing title of a poll should close/open the poll
This commit is contained in:
@ -9,9 +9,12 @@ var Poll = Discourse.Model.extend({
|
|||||||
this.updateFromJson(this.get('post.poll_details'));
|
this.updateFromJson(this.get('post.poll_details'));
|
||||||
}.observes('post.poll_details'),
|
}.observes('post.poll_details'),
|
||||||
|
|
||||||
fetchNewPostDetails: function() {
|
fetchNewPostDetails: Discourse.debounce(function() {
|
||||||
this.get('post.topic.postStream').triggerChangedPost(this.get('post.id'), this.get('post.topic.updated_at'));
|
var self = this;
|
||||||
}.observes('post.topic.title'),
|
Discourse.debounce(function() {
|
||||||
|
self.get('post.topic.postStream').triggerChangedPost(self.get('post.id'), self.get('post.topic.updated_at'));
|
||||||
|
}, 500);
|
||||||
|
}).observes('post.topic.title'),
|
||||||
|
|
||||||
updateFromJson: function(json) {
|
updateFromJson: function(json) {
|
||||||
var selectedOption = json["selected"];
|
var selectedOption = json["selected"];
|
||||||
@ -24,8 +27,8 @@ var Poll = Discourse.Model.extend({
|
|||||||
checked: (option === selectedOption)
|
checked: (option === selectedOption)
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
this.set('options', options);
|
|
||||||
|
|
||||||
|
this.set('options', options);
|
||||||
this.set('closed', json.closed);
|
this.set('closed', json.closed);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user