1 //<Script type="text/javascript">
4 * experiments with mobile UI's
6 * usage: - mobile is a top level widget..
8 * x = new Roo.mobile.Mobile {
16 Roo.mobile.Mobile = function(cfg) {
21 Roo.util.Observable.call(this,cfg);
22 Roo.onReady(function() {
24 this.fireEvent('ready');
30 Roo.extend(Roo.mobile.Mobile, Roo.util.Observable, {
33 //var page = iui.getSelectedPage();
34 ///var locPage = getPageFromLoc();
37 // iui.showPage(page);
39 //if (locPage && (locPage != page))
40 // iui.showPage(locPage);
41 Roo.get(document.head).createChild(
42 '<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>'
45 //setTimeout(preloadImages, 0);
46 if (typeof window.onorientationchange == "object")
48 window.onorientationchange=this.orientChangeHandler;
49 hasOrientationEvent = true;
50 this.orientChangeHandler.defer(0, this);
52 this.checkOrientAndLocation.defer(0, this);
53 this.checkTimer = setInterval(checkOrientAndLocation, 300);
55 orientChangeHandler: function()
57 if (window.orientation == 90 || window.orientation = -90) {
58 this.setOrientation("landscape");
61 this.setOrientation("portrait");
65 setOrientation: function (orient)
67 document.body.setAttribute("orient", orient);
68 setTimeout(scrollTo, 100, 0, 1);