appendToSelectList
void
appendToSelectList(select, option)
- Parameters:
-
select <DOM.SELECT|string> -
option <DOM.OPTION>(todo: support multiple options? or array? (or just plain text also?))
- Returns:
void
disableContextMenu
void
disableContextMenu(element)
todo: create a enableContextMenu also?
todo: support multiple elements?
- Parameters:
-
element <DOM|string>
- Returns:
void
disableTextSelection
void
disableTextSelection(element)
Disables text selection for the element
todo: create a enableTextSelection also?
- Parameters:
-
element <DOM|string>
- Returns:
void
getElementBounds
(x: number, y: number, w: number, h: number)
getElementBounds(element)
extracts both the element's position and size
- Parameters:
-
element <Element|string>
- Returns:
(x: number, y: number, w: number, h: number) - bounds
getElementsByTagName
getElementsByTagName(document, tagName)
todo: deprecate. (only used in SOAP XML-parsing & same as MochiKit.DOM.getElementsByTagAndClassName(tagName, null, document))
! except for one particular sub version of IE6, sigh..
- Parameters:
-
document <DOCUMENT> -
tagName <string>
Deprecated use MochiKit.DOM.getElementsByTagAndClassName() instead
getMousePosition
(x,y)
getMousePosition(mouseEvent)
adjusts the mouse position to be relative the div/element that triggered the event.
(also adjust for window scrolling.)
todo: Why doesn't MochiKit handle this?
- Parameters:
-
mouseEvent <Event>(MochiKit Event)
- Returns:
(x,y)
getScrollOffset
x: number, y: number
getScrollOffset(node)
- Parameters:
-
node <DOM|string>(todo: default to window?)
- Returns:
x: number, y: number
loadScript
void
loadScript(uri, [bodyOrHead='head'], [onLoaded])
todo: change to use Async.Deferred interface?
todo: see http://trac.mochikit.com/ticket/258
- Parameters:
-
uri <string> -
[bodyOrHead='head'] <string|function>(hmm, necessary?) -
[onLoaded] <function>
- Returns:
void
makeLastSibling
void
makeLastSibling(element)
moves the element to the end of it's sibling chain (without disconnecting it)
Useful to bring objects to the front for example (could be called moveToFront?)
(but not guaranteed to be visible, this doesn't care about z-index etc)
- Parameters:
-
element <DOM|string>
- Returns:
void
setElementBounds
void
setElementBounds(element, boundsOrPos, [size])
sets both position and dimension for a DOM element
- Parameters:
-
element <Element|string> -
boundsOrPos <Bounds|Pos>(x, y, w, h) -
[size] <Size>if not present boundsOrPos is assumed to be bounds.
- Returns:
void
toggleBlockVisible
void
toggleBlockVisible(elem)
- Parameters:
-
elem <DOM|string|Array[DOM|string]>
- Returns:
void
toggleEnabled
void
toggleEnabled(elem)
- Parameters:
-
elem <DOM|string|Array[DOM|string]>
- Returns:
void
translateElement
void
translateElement(element, dv., [unit='px'])
- Parameters:
-
element <HTMLElement|string> -
dv. <Vec2>(x:dx, y:dy) vector, can also just specify only one value (default to 0) -
[unit='px'] <string>
- Returns:
void