Jeremy Newman : set the width based on browser width

Jeremy Newman jnewman at winehq.org
Tue Dec 9 11:37:50 CST 2008


Module: website
Branch: master
Commit: a611bc8ad45274d0f4057e122ee46cf3b3f51f53
URL:    http://source.winehq.org/git/website.git/?a=commit;h=a611bc8ad45274d0f4057e122ee46cf3b3f51f53

Author: Jeremy Newman <jnewman at codeweavers.com>
Date:   Tue Dec  9 11:37:31 2008 -0600

set the width based on browser width

---

 templates/en/search.template |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/templates/en/search.template b/templates/en/search.template
index 4eb5847..4c63769 100644
--- a/templates/en/search.template
+++ b/templates/en/search.template
@@ -5,9 +5,20 @@
 
 <div id="cse-search-results"></div>
 <script type="text/javascript">
+  $.gglclientCoords = function() {
+     var dimensions = {width: 0, height: 0};
+     if (document.documentElement) {
+         dimensions.width = document.documentElement.offsetWidth;
+         dimensions.height = document.documentElement.offsetHeight;
+     } else if (window.innerWidth && window.innerHeight) {
+         dimensions.width = window.innerWidth;
+         dimensions.height = window.innerHeight;
+     }
+     return dimensions;
+  }
   var googleSearchIframeName = "cse-search-results";
   var googleSearchFormName = "cse-search-box";
-  var googleSearchFrameWidth = 800;
+  var googleSearchFrameWidth = ($.gglclientCoords().width - 250);
   var googleSearchDomain = "www.google.com";
   var googleSearchPath = "/cse";
 </script>




More information about the wine-cvs mailing list