From 0ea360c4988d0220697346aacb99ba0f87d2d679 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 18 Mar 2011 16:23:22 -0700 Subject: [PATCH] fix ModPlus 'remote profile options' popup for Realtime Switched from one-time setup to live stuff that'll work without per-notice setup. Used to not matter because Realtime wouldn't include the extra stuff, but new Realtime pulls the full rendering, so yay! --- plugins/ModPlus/modplus.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/plugins/ModPlus/modplus.js b/plugins/ModPlus/modplus.js index 2e90de4f19..023dee5762 100644 --- a/plugins/ModPlus/modplus.js +++ b/plugins/ModPlus/modplus.js @@ -4,20 +4,18 @@ */ $(function() { - function ModPlus_setup(notice) { - if ($(notice).find('.remote-profile-options').size()) { - var $options = $(notice).find('.remote-profile-options'); - $options.prepend($()) - $(notice).find('.author').mouseenter(function(event) { - $(notice).find('.remote-profile-options').fadeIn(); - }); - $(notice).mouseleave(function(event) { - $(notice).find('.remote-profile-options').fadeOut(); - }); + $('.notice .author').live('mouseenter', function(e) { + var notice = $(this).closest('.notice'); + var popup = notice.find('.remote-profile-options'); + if (popup.length) { + popup.fadeIn(); + } + }); + $('.notice').live('mouseleave', function(e) { + var notice = $(this); + var popup = notice.find('.remote-profile-options'); + if (popup.length) { + popup.fadeOut(); } - } - - $('.notice').each(function() { - ModPlus_setup(this); }); }); -- 2.39.5