Commit:    26dc98712fcf9fdd72997435732c1a4323d68c4c
Author:    Levi Morrison <[email protected]>         Thu, 5 Dec 2013 15:41:44 -0700
Parents:   fc6030bd5ff4d7f0809a753bfe1dbc94dd722842
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=26dc98712fcf9fdd72997435732c1a4323d68c4c

Log:
Fading of poor user comments now uses only one event instead of one per poor 
comment.

Changed paths:
  M  js/common.js


Diff:
diff --git a/js/common.js b/js/common.js
index cb53703..387a483 100755
--- a/js/common.js
+++ b/js/common.js
@@ -285,16 +285,20 @@ $(document).ready(function() {
             return (value - this.domain.min) * multiplier + this.range.min;
         };
     };
-    $(usernotes).find('.note .tally:contains("-")').each(function() {
-      var id = this.id.replace('V', '');
-      var v = mapper.normalize(this.innerHTML.toInt());
-      var onNoteOver = function() {
-          $(this).fadeTo('fast', 1);
-      };
-      var onNoteOut = function() {
-          $(this).fadeTo('normal', v);
-      };
-      $('#' + id).css('opacity', v).hover(onNoteOver, onNoteOut);
+    $(usernotes).on('mouseenter mouseleave', '.note',  function(event) {
+      var opacity = 1;
+      var $note = $(this);
+      if (event.type === 'mouseleave' && $note.data('opacity') !== undefined) 
{ 
+        opacity = $note.data('opacity');
+      }
+      $note.fadeTo('fast', opacity);
+    }).find('.note').each(function() {
+      var $note = $(this);
+      $note.find('.tally:contains("-")').each(function(){
+        var id = this.id.replace('V', '');
+        var v = mapper.normalize(this.innerHTML.toInt());
+        $note.fadeTo(0, v).data("opacity", v);
+      });
     });
   }
 /* }}} */


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to