diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-12 12:05:27 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-12 12:05:27 +0000 |
commit | f598526d2b661b220e50c6c7f1793ebbb2a402ca (patch) | |
tree | d15d0c40606da12d5b63e34c85ca0b72b2b0dbeb /views/default | |
parent | a1ad344e492f2deb1c738a31deb72d54e0fe223a (diff) | |
download | elgg-f598526d2b661b220e50c6c7f1793ebbb2a402ca.tar.gz elgg-f598526d2b661b220e50c6c7f1793ebbb2a402ca.tar.bz2 |
Icon added to likes and interface tweaked. Likes list js fixed to correctly get height of current list.
git-svn-id: http://code.elgg.org/elgg/trunk@5695 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/css.php | 28 | ||||
-rw-r--r-- | views/default/js/initialise_elgg.php | 4 | ||||
-rw-r--r-- | views/default/likes/forms/edit.php | 13 |
3 files changed, 37 insertions, 8 deletions
diff --git a/views/default/css.php b/views/default/css.php index cc7e86451..e2a8d59b5 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -1447,13 +1447,35 @@ a.action_button:focus { /* *************************************** LIKES *************************************** */ -.user_like_holder { - float:right; -} .likes_list_holder { position: relative; float:right; } +.likes_list_holder a.user_like { + cursor:pointer; + background: url(<?php echo $vars['url']; ?>_graphics/icon_like.png) no-repeat left -2px; + text-indent: -9000em; + text-align: left; + display:block; + width:20px; + height:20px; + margin:0; + float:left; +} +.likes_list_holder a.user_like:hover { + background-position: left -32px; +} +.likes_list_holder .likes_list_button.link { + float:left; + text-align: left; + background: url(<?php echo $vars['url']; ?>_graphics/icon_like.png) no-repeat left -32px; + padding-left:21px; + height:20px; +} +.likes_list_holder .likes_list_button.link.not_liked { + background:none; + padding-left:0; +} .likes_list_holder .likes_list { background-color: white; border:1px solid #cccccc; diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 4679f551c..056e22ee0 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -56,12 +56,12 @@ $(document).ready(function () { // user likes $(".likes_list_button").click(function(event) { if ($(this).next(".likes_list").css('display') == 'none') { // show list - var topPosition = -$('.likes_list').height(); + var topPosition = - $(this).next(".likes_list").height(); $('.likes_list').css('top',topPosition + 10); $('.likes_list').css('left', -$('.likes_list').width()+40); $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500); } else { // hide list - var topPosition = -$('.likes_list').height() + 5; + var topPosition = - $(this).next(".likes_list").height() + 5; $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500); } }); diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php index 1e9cbd02c..99dbe598b 100644 --- a/views/default/likes/forms/edit.php +++ b/views/default/likes/forms/edit.php @@ -12,9 +12,15 @@ if (isset($vars['entity']) && isloggedin()) { $guid = $vars['entity']->getGuid(); $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); + + echo "<span class='likes_list_holder'>"; //check to see if the user has already liked if (!elgg_annotation_exists($guid, 'likes') ) { - echo "<span class='user_like_holder'><a class='user_like link' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a></span>"; + echo "<a class='user_like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>"; + $likes_classname = "not_liked"; + $likes_titletag = ""; + } else { + $likes_titletag = "title='".elgg_echo('likes:remove')."'"; } //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); @@ -25,13 +31,14 @@ if (isset($vars['entity']) && isloggedin()) { $user_string = elgg_echo('likes:userslikedthis'); } - echo "<span class='likes_list_holder'><a class='likes_list_button link'>+" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; + echo "<a class='likes_list_button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>"; //show the users who liked the object echo "<div class='likes_list hidden clearfloat'>"; echo list_annotations($vars['entity']->getGUID(), 'likes', 99); - echo "</div></span>"; + echo "</div>"; } + echo "</span>"; } |