Utilities to create an icon (image, CSS sprite image, or DOM Button).
See the dojox/mobile/iconUtils reference documentation for more information.
Creates a DOM button.
DOM button is a simple graphical object that consists of one or more nested DIV elements with some CSS styling. It can be used in place of an icon image on ListItem, IconItem, and so on. The kind of DOM button to create is given as a class name of refNode. The number of DIVs to create is searched from the style sheets in the page. However, if the class name has a suffix that starts with an underscore, like mblDomButtonGoldStar_5, then the suffixed number is used instead. A class name for DOM button must starts with 'mblDomButton'.
Parameter | Type | Description |
---|---|---|
refNode | DomNode | A node that has a DOM button class name. |
style | Object |
Optional A hash object to set styles to the node. |
toNode | DomNode |
Optional A root node to create a DOM button. If omitted, refNode is used. |
Creates or updates an icon node
If node exists, updates the existing node. Otherwise, creates a new one.
Parameter | Type | Description |
---|---|---|
icon | String | Path for an image, or DOM button class name. |
iconPos | String |
Optional
|
node | DomNode |
Optional
|
title | String |
Optional
|
parent | DomNode |
Optional
|
refNode | DomNode |
Optional
|
pos | String |
Optional
|
A setter function to set an icon.
This function is intended to be used by icon setters (e.g. _setIconAttr)
Parameter | Type | Description |
---|---|---|
icon | String | An icon path or a DOM button class name. |
iconPos | String | The position of an aggregated icon. IconPos is comma separated values like top,left,width,height (ex. "0,0,29,29"). |
iconNode | DomNode | An icon node. |
alt | String |
Optional An alt text for the icon image. |
parent | DomNode | Parent node of the icon. |
refNode | DomNode |
Optional A node reference to place the icon. |
pos | String |
Optional The position of the icon relative to refNode. |
Sets up CSS sprite for a foreground image.
Parameter | Type | Description |
---|---|---|
iconNode | DomNode | |
iconPos | String |