diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-08 09:42:36 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-08 09:42:36 +0000 |
commit | b993fdba7b19aba051c56d4ec73426fc76b583b0 (patch) | |
tree | 222a7f505f67ac0bf4e3dea66d77b6e974ea096a /views/default/js | |
parent | 309433062ad019f61a73cca7090e15a8b6fab4ea (diff) | |
download | elgg-b993fdba7b19aba051c56d4ec73426fc76b583b0.tar.gz elgg-b993fdba7b19aba051c56d4ec73426fc76b583b0.tar.bz2 |
Updated display and position of likes lists. Added js to dismiss list if a click outside the list is detected, also added js so only one list is viewable at a time.
git-svn-id: http://code.elgg.org/elgg/trunk@6392 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/js')
-rw-r--r-- | views/default/js/initialise_elgg.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 2e8d663f7..6b7a318e7 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -56,12 +56,24 @@ $(document).ready(function () { // 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); @@ -70,6 +82,8 @@ $(document).ready(function () { }); /* end document ready function */ + + // display & hide elgg system messages function elgg_system_message() { $("#elgg_system_message").animate({opacity: 0.9}, 1000); |