mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Revert "UX: Let's try an animating heart out"
This reverts commit eb445ca2fc
.
This commit is contained in:
parent
9bb2ab6265
commit
b06cb26f7f
1 changed files with 2 additions and 26 deletions
|
@ -13,18 +13,6 @@ export var Button = function(action, label, icon, opts) {
|
|||
this.opts = this.opts || opts || {};
|
||||
};
|
||||
|
||||
function animateHeart($elem, start, end, complete) {
|
||||
$elem.stop()
|
||||
.css('textIndent', start)
|
||||
.animate({ textIndent: end }, {
|
||||
complete: complete,
|
||||
step: function(now) {
|
||||
$(this).css('-webkit-transform','scale('+now+')');
|
||||
},
|
||||
duration: 300
|
||||
}, 'linear');
|
||||
}
|
||||
|
||||
Button.prototype.render = function(buffer) {
|
||||
var opts = this.opts;
|
||||
|
||||
|
@ -48,6 +36,7 @@ export default Discourse.View.extend(StringBuffer, {
|
|||
|
||||
rerenderTriggers: [
|
||||
'post.deleted_at',
|
||||
'post.flagsAvailable.@each',
|
||||
'post.reply_count',
|
||||
'post.showRepliesBelow',
|
||||
'post.can_delete',
|
||||
|
@ -212,20 +201,7 @@ export default Discourse.View.extend(StringBuffer, {
|
|||
},
|
||||
|
||||
clickLike: function(post) {
|
||||
var $heart = this.$('.fa-heart'),
|
||||
controller = this.get('controller');
|
||||
|
||||
var acted = post.get('actionByName.like.acted');
|
||||
if (acted) {
|
||||
controller.send('toggleLike', post);
|
||||
} else {
|
||||
animateHeart($heart, 1.0, 1.5, function() {
|
||||
animateHeart($heart, 1.5, 1.0, function() {
|
||||
controller.send('toggleLike', post);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.get('controller').send('toggleLike', post);
|
||||
},
|
||||
|
||||
// Flag button
|
||||
|
|
Loading…
Reference in a new issue