Opened 9 years ago
Closed 9 years ago
#14291 closed defect (invalid)
[patch][ccla]dojox.mobile.themeMap base theme in themeMap
Reported by: | Bill Reed | Owned by: | ykami |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | DojoX Mobile | Version: | 1.7.0 |
Keywords: | Cc: | Adam Peller | |
Blocked By: | Blocking: |
Description (last modified by )
I am defining a custom themeMap
dojox.mobile.themeMap=[["Android",null,["../themes/custom/custom.css"]],["BlackBerry",null,["../themes/custom/custom.css"]],["iPad",null,["../themes/custom/custom.css"]],["iPhone",null,["../themes/custom/custom.css"]],[".*",null,["../themes/custom/custom.css"]]]; });
I do not want a base theme added to the head but dojox.mobile.deviceTheme expects a base, deviceTheme adds a link to
<link href="../../../dojox/mobile/themes/null/null.css" type="text/css" rel="stylesheet">
it would be nice if loadDeviceTheme would check the base theme for null before adding it to the head to prevent a 404 error
I have attached a html file with the test case and a example dojox.mobile.deviceTheme.js that has been patched
Attachments (2)
Change History (9)
Changed 9 years ago by
Attachment: | my_test_iPhone-Heading.html added |
---|
comment:1 Changed 9 years ago by
Cc: | Adam Peller added |
---|---|
Description: | modified (diff) |
Milestone: | → tbd |
comment:2 Changed 9 years ago by
Summary: | dojox.mobile.themeMap base theme in themeMap → [patch][ccla]dojox.mobile.themeMap base theme in themeMap |
---|
comment:3 Changed 9 years ago by
I do not think defining a theme folder name as null makes sense because this module is a theme loader. How about setting dojox.mobile.themeFiles to []? That should prevent deviceTheme to load a base theme file.
comment:4 Changed 9 years ago by
If the user wants to override the default themeMap with a custom themeMap for devices the user can define a themeMap as:
dojox.mobile.themeMap=[["Android",null,["../themes/custom/mydroid.css"]],["BlackBerry",null,["../themes/custom/custom.css"]],["iPad",null,["../themes/custom/custom.css"]],["iPhone",null,["../themes/custom/myPhone.css"]],[".*",null,["../themes/custom/custom.css"]]]; });
If the user defines a base theme
dojox.mobile.themeMap=[["Android","android",["../themes/custom/mydroid.css"]],["BlackBerry","blackberry",["../themes/custom/custom.css"]],["iPad",null,["../themes/custom/custom.css"]],["iPhone",null,["../themes/custom/myPhone.css"]],[".*",null,["../themes/custom/custom.css"]]]; });
That base theme is also loaded, if the user has decided to remove a css rule in their myAndroid.css theme the through css cascade the css rule from the base theme will still be used. This is not the result that the user was after.
So by not defining a base theme for a device, deviceTheme will not load the dojox.mobile theme and only load the theme specified in the themeMap.
I tried your suggestion:
dojox.mobile.themeMap=[["Android",[],["../themes/custom/mydroid.css"]],["BlackBerry",[],["../themes/custom/custom.css"]],["iPad",[],["../themes/custom/custom.css"]],["iPhone",[],["../themes/custom/myPhone.css"]],[".*",[],["../themes/custom/custom.css"]]]; });
And I still see this in the console:
GET file:///C:/workspace_helious_64/all/dojox/mobile/themes//.css
comment:5 Changed 9 years ago by
I meant dojox.mobile.themeFiles to [], not dojox.mobile.themeMap. Its default value is [ "@theme" ]. And "@theme" means a base theme file for a detected device such as iphone.css. Please see the inline doc for details.
comment:6 Changed 9 years ago by
Thanks, that does the job...
require(["dojox/mobile"],function(dojoxMobile){dojoxMobile.themeMap=[["Android","",["themes/custom/custom.css"]],["BlackBerry","",["themes/custom/custom.css"]],["iPad","",["themes/custom/custom.css"]],["iPhone","",["themes/custom/custom.css"]],[".*","",["themes/custom/custom.css"]]];dojoxMobile.themeFiles = [];});
comment:7 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
html test case