// user likes
$(".likes_list_button").click(function(event) {
if ($(this).next(".likes_list").css('display') == 'none') { // show list
+ // hide any other currently viewable likes lists
+ $('.likes_list').fadeOut();
+
var topPosition = - $(this).next(".likes_list").height();
topPosition10 = topPosition + 10 + "px";
- topPosition = topPosition + "px";
+ topPosition = topPosition - 5 + "px";
$('.likes_list').css('top',topPosition10);
- $('.likes_list').css('left', -$('.likes_list').width()+40);
+ $('.likes_list').css('left', -$('.likes_list').width()+110);
$(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
+
+ // set up cancel for a click outside the likes list
+ $(document).click(function(event) {
+ var target = $(event.target);
+ if (target.parents(".likes_list_holder").length == 0) {
+ $(".likes_list").fadeOut();
+ }
+ });
+
} else { // hide list
var topPosition = - $(this).next(".likes_list").height() + 5;
$(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
}); /* end document ready function */
+
+
// display & hide elgg system messages
function elgg_system_message() {
$("#elgg_system_message").animate({opacity: 0.9}, 1000);