DataZombies / jQTouch

jQT extensions jqt.activityIndicator, jqt.bars (with numeric badges), jqt.checkGroup & jqt.segmentedControl.Get updates via Twitter http://twitter.com/HeadDZombie. If you find this fork useful please make a donation via PayPal (http://tinyurl.com/2fpmx27). See below for demo links.
MIT License
159 stars 34 forks source link

Orientation in Phonegap (iphone) and unable to refresh the page height and tabbar width #15

Closed notfair closed 13 years ago

notfair commented 13 years ago

After I make a orientation change on the app, the tabbar do not resize/ refresh at all (I mean the width of the icon container inside the tabbar). Then the content of the page as well, it do not refresh. I think it unable to call the setHeight/refresh function because it only refresh when I navigate to other page.

The .bind('turn') not working in phonegap, I use this function to listen to the orientation change, but it is like did not call any of this setPageHeight(), setBarWidth() i think.

document.addEventListener("orientationChanged", function(){ setPageHeight(); setBarWidth(); });

DataZombies commented 13 years ago

In jqt.bars.js lines 296 - 303 addresses this issue. I don't support phone gap so I have no opinion on you proposed solution. Please contact the phone gap team.

ghowen commented 13 years ago

phonegap uses a different event for orientation changes. I solved this problem this way:

// phonegap orientation change event 
document.addEventListener("orientationChanged", function(e) {
    setTimeout(function() {                                                                      
        // navigator.notification.alert(window.innerHeight);
        jQT.setPageHeight();
    } , 500);
}); 
notfair commented 13 years ago

oic, thank!