09-13-2012 02:50 PM - edited 09-13-2012 03:06 PM
Ok, so I wanted to update my WebWorks Testing app (https://github.com/SCrid2000/WebWorks-Testing) to make it easier to test webworks apps for the difference in screen resolution between the Dev Alpha and the forthcoming BlackBerry 10.
Basically, rather than opening your html, js, and css files directly in the testing app, the update would open your files in an iframe within the app. The iframe will resize based on the device orientation.
The javascript function looks like this:
function displayCurrentOrientation() {
if (window.orientation === 0) {
document.getElementById("currentOrientation").widt h = '1280px';
document.getElementById("currentOrientation").heig ht = '720px';
return false;
}
if (window.orientation === 90) {
document.getElementById("currentOrientation").widt h = '720px';
document.getElementById("currentOrientation").heig ht = '1280px';
return false;
}
if (window.orientation === 180) {
document.getElementById("currentOrientation").widt h = '1280px';
document.getElementById("currentOrientation").heig ht = '720px';
return false;
}
if (window.orientation === -90) {
document.getElementById("currentOrientation").widt h = '720px';
document.getElementById("currentOrientation").heig ht = '1280px';
return false;
}
}
Now it works just perfect on the PlayBook (but obviously that's not much help for testing for BB10)
However, on the Dev Alpha it ONLY works in LANDSCAPE; that is, if the app is launched in landscape, the iframe rezises and everything is just perfect. If the testing app is launched in portrait, the iframe is still resized to the portrait size.
Does anyone have any suggestions for what I'm doing wrong? I'm totally at a loss here (and since it's a free and open source app, I'm not too motivated to spend another couple hours trying to fix it lol).
Thanks.
Shane
Solved! Go to Solution.
09-13-2012 05:39 PM
09-14-2012 11:32 AM
So did you confirm that the orientation events are not firing in the Dev Alpha Beta OS?
There is a small error in your config file:
https://github.com/SCrid2000/WebWorks-Testing/blob
09-14-2012 11:47 AM