|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
/*globals ajaxify, config, utils, NProgress*/
|
|
|
|
|
/*globals ajaxify, config, utils, templates, app, Slideout, NProgress*/
|
|
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
setupNProgress();
|
|
|
|
@ -175,18 +175,23 @@ $(document).ready(function() {
|
|
|
|
|
var card = $(html);
|
|
|
|
|
avatar.parents('a').after(card.hide());
|
|
|
|
|
|
|
|
|
|
card.find('.btn-morph').click(function(event){
|
|
|
|
|
$(this).toggleClass('plus').toggleClass('heart');
|
|
|
|
|
if (parseInt(app.user.uid, 10) === parseInt(data.uid, 10)) {
|
|
|
|
|
card.find('.btn-morph').hide();
|
|
|
|
|
} else {
|
|
|
|
|
card.find('.btn-morph').click(function(ev){
|
|
|
|
|
$(this).toggleClass('plus').toggleClass('heart');
|
|
|
|
|
|
|
|
|
|
if ($(this).find("b.drop").length == 0) {
|
|
|
|
|
$(this).prepend("<b class='drop'></b>");
|
|
|
|
|
}
|
|
|
|
|
if ($(this).find('b.drop').length === 0) {
|
|
|
|
|
$(this).prepend('<b class="drop"></b>');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var drop = $(this).find("b.drop").removeClass("animate");
|
|
|
|
|
x = event.pageX - drop.width()/2 - $(this).offset().left;
|
|
|
|
|
y = event.pageY - drop.height()/2 - $(this).offset().top;
|
|
|
|
|
drop.css({top: y+'px', left: x+'px'}).addClass("animate");
|
|
|
|
|
});
|
|
|
|
|
var drop = $(this).find('b.drop').removeClass('animate'),
|
|
|
|
|
x = ev.pageX - drop.width() / 2 - $(this).offset().left,
|
|
|
|
|
y = ev.pageY - drop.height() / 2 - $(this).offset().top;
|
|
|
|
|
|
|
|
|
|
drop.css({top: y + 'px', left: x + 'px'}).addClass('animate');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
utils.makeNumbersHumanReadable($('.human-readable-number'));
|
|
|
|
|
|
|
|
|
@ -198,8 +203,7 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
card.fadeIn();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|