changeset 13:e34413f21290

added window resize handler.
author Atul Varma <avarma@mozilla.com>
date Sun, 02 May 2010 19:40:01 -0700
parents 7f3585a8c8a3
children c156c147c741
files index.html
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/index.html	Sun May 02 19:36:12 2010 -0700
+++ b/index.html	Sun May 02 19:40:01 2010 -0700
@@ -249,10 +249,10 @@
   var touchMoved = false;
   var matrix = new WebKitCSSMatrix();
 
-  var maxHeight = node.parentNode.scrollHeight -
-                  node.parentNode.clientHeight;
+  function accelerate(delta) {
+    var maxHeight = node.parentNode.scrollHeight -
+                    node.parentNode.clientHeight;
 
-  function accelerate(delta) {
     matrix = matrix.translate(0, delta);
     if (matrix.f > 0)
       matrix.f = 0;
@@ -358,9 +358,15 @@
   }
 })();
 
+function resize() {
+  $("#letters").css({"max-height": document.body.clientHeight});
+}
+
+$(window).bind("resize", resize);
+
 $(window).bind("DOMContentLoaded", function() {
+  resize();
   $("#letters .palette-container").each(addLetters);
-  $("#letters").css({"max-height": document.body.clientHeight});
   $(".palette-container").each(makeScrollable);
 });
 </script>