Commits

Jiyin Yiyong committed ea9923c

comment focus event

Comments (0)

Files changed (2)

 };
 run = false;
 window.onload = function(){
-  var canvas, lottery, go, cx, cy, r, point, p, choice, cal, x$, setFont, draw, theta, toggle;
+  var canvas, lottery, go, cx, cy, r, point, p, choice, cal, x$, setFont, draw, theta;
   canvas = query('canvas');
   lottery = query('#lottery');
   go = query('#go');
     log("click");
     return toggle();
   };
-  return toggle = function(){
+  return window.toggle = function(){
     if (go.innerText === "Start") {
       go.innerText = "Go";
       return run = true;
       return run = false;
     }
   };
-};
-window.onfocus = function(){
-  style.webkitFilter = "";
-  style.background = "hsl(0,80%,96%)";
-  return run = true;
-};
-window.onblur = function(){
-  style.webkitFilter = "grayscale(0.5) blur(4px)";
-  run = false;
-  return style.background = "hsl(0,80%,95%)";
 };
     log "click"
     toggle!
 
-  toggle = ->
+  window.toggle = ->
     if go.inner-text is "Start"
       go.inner-text = "Go"
       run := yes
       go.inner-text = "Start"
       run := no
 
-window.onfocus = ->
-  style.webkit-filter = ""
-  style.background = "hsl(0,80%,96%)"
-  run := yes
-
-window.onblur = ->
-  style.webkit-filter = "grayscale(0.5) blur(4px)"
-  run := no
-  style.background = "hsl(0,80%,95%)"
+# window.onfocus = ->
+#   if (query \#go).inner-text is "Start"
+#     style.webkit-filter = ""
+#     style.background = "hsl(0,80%,96%)"
+#     run := yes
+
+# window.onblur = ->
+#   if (query \#go).inner-text is "Go"
+#     style.webkit-filter = "grayscale(0.5) blur(4px)"
+#     style.background = "hsl(0,80%,95%)"
+#     toggle!