diff options
author | Sarven Capadisli <csarven@csarven-laptop.(none)> | 2009-05-23 22:28:36 -0400 |
---|---|---|
committer | Sarven Capadisli <csarven@csarven-laptop.(none)> | 2009-05-23 22:28:36 -0400 |
commit | 5a1c95d52fdca199957e47903819d16acaea590e (patch) | |
tree | f56816200d6e2a260b86ffdba5f4320c2e9aa016 /js/util.js | |
parent | 1e04e68044ae7a39c64b0e2d66ce78c527dca200 (diff) | |
parent | fde9b09435f6d7fc6cb3f8ccc37dcb3f5ccdb056 (diff) |
Merge branch '0.8.x' of git://gitorious.org/laconica/dev into 0.8.x
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/js/util.js b/js/util.js index 31d9eb4f5..baa3f119e 100644 --- a/js/util.js +++ b/js/util.js @@ -203,7 +203,6 @@ $(document).ready(function(){ $("#notices_primary .notices").prepend(document._importNode(li, true)); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(2500); - NoticeHover(); NoticeReply(); } } @@ -221,24 +220,23 @@ $(document).ready(function(){ NoticeReply(); }); + function NoticeHover() { - $("#content .notice").hover( - function () { - $(this).addClass('hover'); - }, - function () { - $(this).removeClass('hover'); - } - ); + function mouseHandler(e) { + $(e.target).closest('li.hentry')[(e.type === 'mouseover') ? 'addClass' : 'removeClass']('hover'); + }; + $('#content .notices').mouseover(mouseHandler); + $('#content .notices').mouseout(mouseHandler); } + function NoticeReply() { if ($('#notice_data-text').length > 0) { $('#content .notice').each(function() { - var notice = $(this); - $('.notice_reply', $(this)).click(function() { - var nickname = ($('.author .nickname', notice).length > 0) ? $('.author .nickname', notice) : $('.author .nickname'); - NoticeReplySet(nickname.text(), $('.notice_id', notice).text()); + var notice = $(this)[0]; + $($('.notice_reply', notice)[0]).click(function() { + var nickname = ($('.author .nickname', notice).length > 0) ? $($('.author .nickname', notice)[0]) : $('.author .nickname'); + NoticeReplySet(nickname.text(), $($('.notice_id', notice)[0]).text()); return false; }); }); |