function updateHomescreen()\r
{\r
if (config['useBackgroundImage'].Value) {\r
+ // check if we have a completely unknown screen resolution\r
+ var screenHeight = screen.height;\r
+ var screenWidth = screen.width;\r
+ if (screenHeight != 640 && screenHeight != 480 && screenHeight != 360)\r
+ screenHeight = 360; // we can only assume we're in portrait mode, so we set the screen dims as needed for the following code\r
+ if (screenWidth != 640 && screenWidth != 480 && screenWidth != 360)\r
+ screenWidth = 640; // we can only assume we're in portrait mode, so we set the screen dims as needed for the following code\r
+ \r
// check for screen rotation\r
- if (orientation != 'portrait' && screen.width == 360 && screen.height == 640) {\r
+ if (orientation != 'portrait' && ((screenWidth == 360 && screenHeight == 640) || (screenWidth == 640 && screenHeight == 480))) {\r
window.widget.prepareForTransition("fade");\r
orientation = 'portrait';\r
document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')';\r
document.getElementById('body').style.backgroundColor = 'none';\r
window.widget.performTransition();\r
- } else if (orientation != 'landscape' && screen.width == 640 && screen.height == 360) {\r
+ } else if (orientation != 'landscape' && ((screenWidth == 640 && screenHeight == 360) || (screenWidth == 480 && screenHeight == 640))) {\r
window.widget.prepareForTransition("fade");\r
orientation = 'landscape';\r
document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')';\r