Roo/mobile/Mobile.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 24 Nov 2010 08:04:46 +0000 (16:04 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 24 Nov 2010 08:04:46 +0000 (16:04 +0800)
Roo/mobile/Mobile.js

index e69de29..9e7f3f2 100644 (file)
@@ -0,0 +1,54 @@
+//<Script type="text/javascript">
+
+/**
+ * experiments with mobile UI's
+ * 
+ * usage: - mobile is a top level widget..
+ * 
+ * x = new Roo.mobile.Mobile {
+    items : {
+        Roo.mobile.Page
+        *}
+     }
+ * 
+ */
+
+Roo.mobile.Mobile = function(cfg) {
+     
+    this.addEvents({ 
+        'ready' : true
+    });
+    Roo.util.Observable.call(this,cfg);
+    Roo.onReady(function() {
+        this.init();
+        this.fireEvent('ready');
+    },this,false);
+    
+}
+
+
+Roo.extend(Roo.mobile.Mobile, Roo.util.Observable, {
+    function init()
+    {
+        //var page = iui.getSelectedPage();
+        ///var locPage = getPageFromLoc();
+            
+        //if (page)
+        //        iui.showPage(page);
+        
+        //if (locPage && (locPage != page))
+        //    iui.showPage(locPage);
+        
+        //setTimeout(preloadImages, 0);
+        if (typeof window.onorientationchange == "object")
+        {
+            window.onorientationchange=this.orientChangeHandler;
+            hasOrientationEvent = true;
+            this.orientChangeHandler.defer(0, this);
+        }
+        this.checkOrientAndLocation.defer(0, this);
+        this.checkTimer = setInterval(checkOrientAndLocation, 300);
+    }
+});
+
+