try and get ctrl-enter to add a clear all
[roojs1] / Roo / mobile / Mobile.js
index 9e7f3f2..9b0d21c 100644 (file)
@@ -28,7 +28,7 @@ Roo.mobile.Mobile = function(cfg) {
 
 
 Roo.extend(Roo.mobile.Mobile, Roo.util.Observable, {
-    function init()
+     init: function()
     {
         //var page = iui.getSelectedPage();
         ///var locPage = getPageFromLoc();
@@ -38,7 +38,10 @@ Roo.extend(Roo.mobile.Mobile, Roo.util.Observable, {
         
         //if (locPage && (locPage != page))
         //    iui.showPage(locPage);
-        
+        Roo.get(document.head).createChild(
+            '<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>'
+        );
+        //?? add the css?
         //setTimeout(preloadImages, 0);
         if (typeof window.onorientationchange == "object")
         {
@@ -49,6 +52,22 @@ Roo.extend(Roo.mobile.Mobile, Roo.util.Observable, {
         this.checkOrientAndLocation.defer(0, this);
         this.checkTimer = setInterval(checkOrientAndLocation, 300);
     }
+    orientChangeHandler: function()
+    {
+        if (window.orientation == 90 || window.orientation = -90) {
+            this.setOrientation("landscape");
+            return;
+        }
+        this.setOrientation("portrait");
+        
+    },
+    
+    setOrientation: function (orient)
+    {
+        document.body.setAttribute("orient", orient);
+        setTimeout(scrollTo, 100, 0, 1);
+    },
+
 });