dojox/mobile/iconUtils (version 1.10)

Summary

Utilities to create an icon (image, CSS sprite image, or DOM Button).

See the dojox/mobile/iconUtils reference documentation for more information.

Property Summary

Method Summary

  • createDomButton(refNode,style,toNode) Creates a DOM button.
  • createIcon(icon,iconPos,node,title,parent,refNode,pos) Creates or updates an icon node
  • setIcon(icon,iconPos,iconNode,alt,parent,refNode,pos) A setter function to set an icon.
  • setupSpriteIcon(iconNode,iconPos) Sets up CSS sprite for a foreground image.

Properties

iconWrapper

Methods

createDomButton(refNode,style,toNode)

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.

createIcon(icon,iconPos,node,title,parent,refNode,pos)

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
setIcon(icon,iconPos,iconNode,alt,parent,refNode,pos)

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.

setupSpriteIcon(iconNode,iconPos)

Sets up CSS sprite for a foreground image.

Parameter Type Description
iconNode DomNode
iconPos String
Error in the documentation? Can’t find what you are looking for? Let us know!