Change the mouse listeners to be on the <canvas> element
authorrsesek <rsesek@ad1dcce9-c9fe-0310-b82b-83ea1733dbb0>
Sat, 11 Dec 2010 18:57:26 +0000 (18:57 +0000)
committerrsesek <rsesek@ad1dcce9-c9fe-0310-b82b-83ea1733dbb0>
Sat, 11 Dec 2010 18:57:26 +0000 (18:57 +0000)
git-svn-id: svn://depot/macosx/RGBConverter/trunk@640 ad1dcce9-c9fe-0310-b82b-83ea1733dbb0

RGB Converter.wdgt/Widget.html
RGB Converter.wdgt/Widget.js

index 87c9b328fe1f72981251ebebe7beb2fc5d1d613b..923f31d3ba0ac57a070f60dea5e5fc80c052f9b5 100644 (file)
 </head>
 
 <body onload="setup()">
-  <img src="Default.png" id="shadow" />
-  <canvas id="wheel" width="186" height="186"></canvas>
+  <img src="Default.png" id="shadow"/>
+  <canvas id="wheel" width="186" height="186" onmousemove="mousemove(event);" onmouseout="mouseexit(event);"></canvas>
   <!-- front -->
-  <div id="front" onmousemove="mousemove(event);" onmouseout="mouseexit(event);">    
+  <div id="front"> 
     <input type="text" name="hexinput" id="hexinput" size="6" onblur="hexwatcher()" value="3C3C3C" />
 
     <input type="text" name="redinput" id="redinput" size="3" onblur="rgbwatcher('red')" value="60" />
index 246a95869ef948e0e62bfc0b2937cf584b0d9b9a..adb01bfb4b0a6bc25ad5400ecafe91e38aa9cbde 100644 (file)
@@ -344,6 +344,9 @@ var animation = {
 
 function mousemove(event)
 {
+  if (backShowing_)
+    return;
+
   if (!flipShown)
   {
     if (animation.timer != null)
@@ -367,6 +370,9 @@ function mousemove(event)
 
 function mouseexit(event)
 {
+  if (backShowing_)
+    return;
+
   if (flipShown)
   {
     // fade in the flip widget