diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-08-30 22:52:44 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-08-30 22:52:44 -0400 |
| commit | 968faa6192e7c95a7b1cbfdd5d35fb7253b8984f (patch) | |
| tree | 4fb8a9ef7f9c63f20721839c8f3d664cc2630b4b /static/js | |
| parent | 267ad6ad5ef1e906c0ca6b040056ee7699545a55 (diff) | |
Fixed directory queries and heart animations
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/pichat.js | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index 9287cc1..13e0036 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -501,7 +501,7 @@ function initChat() { messageList = $("#messageList")[0] - initChatThumb() + initChatThumb(); scrollToEnd() scrollWatcher() @@ -583,14 +583,13 @@ function initLog() { var t = $(this); t.html(buildMsgContent(t.text())); }); - initLogThumb(); + initLogThumb(".logged-dump .thumb", '.dump'); } -// jesus this logic is ugly -function initLogThumb(){ - $(".logged-dump .thumb").bind('mouseover mouseout', +function initLogThumb(selector, parentSelector) { + $(selector).bind('mouseover mouseout', function(e) { - var favorited = $(this).parents(".dump").hasClass("favorite") ? true : false; + var favorited = $(this).parents(parentSelector).hasClass("favorite") ? true : false; if (e.type == "mouseover") { if (favorited) { $(this).attr("src", Imgs.logThumbOff); @@ -602,17 +601,16 @@ function initLogThumb(){ if (favorited) { $(this).attr("src", Imgs.logThumb); $(this).stop().animate(Anim.logThumb, 'fast'); - } else { + } else { $(this).attr("src", Imgs.logThumbOff); $(this).stop().animate(Anim.logThumb, 'fast'); } } }) -} + } -function initChatThumb(){ - - $(".chat-thumb").live('mouseover mouseout', +function initChatThumb() { + $(".chat-thumb").live('mouseover mouseout', function(e) { var favorited = $(this).parents(".dump").hasClass("favorite") ? true : false; if (e.type == "mouseover") { @@ -625,18 +623,27 @@ function initChatThumb(){ } else { // mouseout if (favorited) { $(this).attr("src", Imgs.chatThumb); + var favorited = $(this).parents(".dump").hasClass("favorite") ? true : false; + if (e.type == "mouseover") { + if (favorited) { + $(this).attr("src", Imgs.chatThumbOff); + } else { + $(this).attr("src", Imgs.chatThumbBig); + $(this).stop().animate(Anim.chatThumbBig, 'fast') + } + } else { // mouseout + if (favorited) { + $(this).attr("src", Imgs.chatThumb); $(this).stop().animate(Anim.chatThumb, 'fast'); - } else { - $(this).stop().animate(Anim.chatThumbTiny, 'fast', 'swing', + } else { + $(this).stop().animate(Anim.chatThumbTiny, 'fast', 'swing', function(){ $(this).attr("src", Imgs.chatThumbDot) - $(this).animate(Anim.chatThumb, 0) + $(this).animate(Anim.chatThumb, 0) }) + }} } - } - }) -} - + }})} function paletteToChat(img){ var chatText = $("#msgInput").val() @@ -986,7 +993,8 @@ function initDirectory() { var t = $(this); t.html(buildMsgContent(t.text())); }); - Search.init() + Search.init() + initLogThumb('.dlogged-dump .thumb', '.dlogged-dump'); } //big hand stuff |
