This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/excerpt/excerpt_post_view.js

31 lines
726 B
JavaScript

(function() {
window.Discourse.ExcerptPostView = Ember.View.extend({
mute: function() {
return this.update(true);
},
unmute: function() {
return this.update(false);
},
refreshLater: Discourse.debounce((function() {
return this.get('controller.controllers.listController').refresh();
}), 1000),
update: function(v) {
var _this = this;
this.set('muted', v);
return jQuery.post("/t/" + this.topic_id + "/" + (v ? "mute" : "unmute"), {
_method: 'put',
success: function() {
/* I experimented with this, but if feels like whackamole
*/
/* @refreshLater()
*/
}
});
}
});
}).call(this);