From 7e0a314768fed3c5964e9d404d33a243277559ce Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 24 May 2009 01:38:11 +0000 Subject: Using event bubbling instead of event handling thanks to Ara Pehlivanian http://arapehlivanian.com --- js/util.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/js/util.js b/js/util.js index 2dfaafd76..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,17 +220,16 @@ $(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() { -- cgit v1.2.3-54-g00ecf From fde9b09435f6d7fc6cb3f8ccc37dcb3f5ccdb056 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 24 May 2009 01:53:08 +0000 Subject: Changing opacity to 1 only on the hovered notice item --- theme/default/css/display.css | 4 +++- theme/identica/css/display.css | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/theme/default/css/display.css b/theme/default/css/display.css index 16c9322a5..bc6bd2ee4 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -193,7 +193,9 @@ background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-r } .notices div.entry-content, -.notices div.notice-options { +.notices div.notice-options, +.notices li.hover .notices div.entry-content, +.notices li.hover .notices div.notice-options { opacity:0.4; } .notices li.hover div.entry-content, diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 2fb123a20..b181d9056 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -193,7 +193,9 @@ background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-r } .notices div.entry-content, -.notices div.notice-options { +.notices div.notice-options, +.notices li.hover .notices div.entry-content, +.notices li.hover .notices div.notice-options { opacity:0.4; } .notices li.hover div.entry-content, -- cgit v1.2.3-54-g00ecf