#13986 closed defect (fixed)
Using dojox.mobile.deviceTheme.loadDeviceTheme('Android') does not load -compat.css
Reported by: | Bill Reed | Owned by: | ykami |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | DojoX Mobile | Version: | 1.7.0b1 |
Keywords: | Cc: | Adam Peller | |
Blocked By: | Blocking: |
Description
When using dojox.mobile.deviceTheme.loadDeviceTheme('Android') to switch mobile themes at runtime on firefox the theme is switched from iphone (the default at load time) to Android the android.css file is added to the head but the corresponding android-compt.css is not. Also the previous theme css files are left in the head.
I have attached a html file that reproduces the problem as well as updated dojox.mobile.deviceTheme.js and dojox.mobile._compat.js that fix both the removing of old theme css files and the loading of -compat.css files
Attachments (5)
Change History (12)
Changed 11 years ago by
Attachment: | my_ test_Custom-Heading.html added |
---|
comment:1 Changed 11 years ago by
Cc: | Adam Peller added |
---|
comment:2 Changed 11 years ago by
Thank you for the patch. But we need to think about if it is really a useful and necessary feature in general. Also, it looks the patch needs some rework. And I think you should be able to manage by yourself without it.
comment:3 Changed 11 years ago by
The patch was only a example of a solution, I will rework the solution if you would like. The issue I am attempting to address is we have a requirement in Maqetta.org to support users developing and deploying custom mobile theme's The design approach we have selected is to leverage dojox.mobile.deviceTheme We would add a line of code to the user's html file to change the dojox.mobile.themeMap to include the users css theme file. For example
dojox.mobile.themeMap=Android","android",["myandroid.css?,["BlackBerry?","blackberry",mybb.css?],["iPad","iphone",[require.toUrl("dojox/mobile/themes/iphone/ipad.css")]],["Custom","custom",[]],["mobile3","",themes/mobile3/mobile3.css?],[".*","iphone",iphone.css?]];
Currently we have code that connect's to the loadDeviceTheme and keeps track of the css files loaded, and removes theme. But we will need to duplicated that code in multiple places in maqetta as well as possible forcing the user to add the code to every html where they would like to do dynamic theme switching. Which would not be that uncommon when mocking up a UI. Moving the code for removing old theme files into deviceTheme seems to only be logical, since code has been added to allow user's of deviceTheme (loadDeviceTheme(ua) to dynamically switch theme's.
comment:4 Changed 11 years ago by
ok, I understand your motivation and requirement, but the patch doesn't look good. I will try implementing your requirement with minimum code size increase.
comment:7 Changed 11 years ago by
Milestone: | tbd → 1.7 |
---|
html file to switch themes at runtime