mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 15:41:51 +08:00
Revert "FIX: reply after like does nothing"
This reverts commit 52a94090c4
.
This commit is contained in:
parent
52a94090c4
commit
239d4d9d47
|
@ -59,26 +59,16 @@ export default Discourse.View.extend({
|
||||||
buffer.push("</nav>");
|
buffer.push("</nav>");
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement: function(){
|
// Delegate click actions
|
||||||
// @Robin, why is this being called twice on initial render?
|
click: function(e) {
|
||||||
// this is a workaround to try to fix https://meta.discourse.org/t/click-on-reply-sometimes-without-effect/19860
|
|
||||||
var self = this;
|
|
||||||
var $self = this.$();
|
|
||||||
|
|
||||||
$self.off('click.post').on('click.post', function(e){
|
|
||||||
var $target = $(e.target),
|
var $target = $(e.target),
|
||||||
action = $target.data('action') || $target.parent().data('action');
|
action = $target.data('action') || $target.parent().data('action');
|
||||||
|
|
||||||
if (!action) return;
|
if (!action) return;
|
||||||
var handler = self["click" + action.capitalize()];
|
var handler = this["click" + action.capitalize()];
|
||||||
if (!handler) return;
|
if (!handler) return;
|
||||||
|
|
||||||
handler.call(self, self.get('post'));
|
handler.call(this, this.get('post'));
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
willDestroyElement: function(){
|
|
||||||
this.$().off('click.post');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Replies Button
|
// Replies Button
|
||||||
|
|
Loading…
Reference in New Issue
Block a user