-
1 May 2012 5:04 AM #1
Ext.browser.is.WebView should be false for Ext.os.is.Desktop
Ext.browser.is.WebView should be false for Ext.os.is.Desktop
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.1
Browser versions tested against:- Safari 5.1.5
- PhoneGap 1.5.0
DOCTYPE tested against:- HTML5
Description:- If you add the PhoneGap script tag to your index.html and require Ext.device.Device, you'll get the following error: . This is because the Ext.browser.is.WebView flag only checks for the existence of window.PhoneGap (or Cordova), while it should also check if we're in fact on a phone. Because it doesn't, the Ext.device.* classes construct the PhoneGap subclasses. And since Ext.device.Device.PhoneGap tries to read device.* upon construction.. it fails.Code:
JavaScript error: ReferenceError: Can't find variable: device on line 10 for sdk/src/device/device/PhoneGap.js
Steps to reproduce the problem:- Create a blank app
- Add the PhoneGap/Cordova script and script-tag
- Open the app on your desktop (or try to sencha app build package it).
The result that was expected:- Use of the Ext.device.*.Simulator classes
The result that occurs instead:- Use of the Ext.device.*.Phonegap classes
- The described error
HELPFUL INFORMATION
Debugging already done:- Hours of trail and error
Possible fix:- Only set the WebView flag if we're on a phone
Additional CSS used:- only default ext-all.css
Operating System:- Mac OS X Lion
-
1 May 2012 5:23 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Thank you for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 May 2012 8:41 AM #3
Fixed for the next release. Thanks!
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2868
in
Sprint 22 (2.0.2).


Reply With Quote