update documentation

This commit is contained in:
rolux 2012-06-02 14:10:47 +02:00
parent 73fa856900
commit ea08852676
2 changed files with 74 additions and 74 deletions

View file

@ -1,77 +1,77 @@
'use strict'; 'use strict';
/*@ /*@
Ox.Element <function> Basic UI element object Ox.Element <f> Basic UI element object
# Usage --------------------------------------------------------------------
([options[, self]]) -> <object:Ox.JQueryElement> Element object
# Arguments ---------------------------------------------------------------- # Arguments ----------------------------------------------------------------
options <object|string> Options of the element, or just `element` option options <o|s> Options of the element, or just the `element` option
# Properties element <s> Tagname or CSS selector
element <string> Tagname or CSS selector tooltip <s|f> Tooltip title, or a function that returns one
tooltip <string|function> Tooltip title, or a function that returns one (e) -> <s> Tooltip title
(e) -> <string> tooltip title e <o> Mouse event
e <object> mouse event self <o> Shared private variable
self <object> Shared private variable # Usage --------------------------------------------------------------------
# Events ------------------------------------------------------------------- ([options[, self]]) -> <o:Ox.JQueryElement> Element object
anyclick <event> anyclick # Events ---------------------------------------------------------------
Fires on mouseup, but not on any subsequent mouseup within 250 ms (this anyclick <!> anyclick
is useful if one wants to listen for singleclicks, but not doubleclicks, Fires on mouseup, but not on any subsequent mouseup within 250 ms
since it will fire immediately, and won't fire again in case of a (this is useful if one wants to listen for singleclicks, but not
doubleclick) doubleclicks, since it will fire immediately, and won't fire again
* <*> original event properties in case of a doubleclick)
doubleclick <event> doubleclick * <*> Original event properties
Fires on the second mousedown within 250 ms (this is useful if one wants doubleclick <!> doubleclick
to listen for both singleclicks and doubleclicks, since it will not Fires on the second mousedown within 250 ms (this is useful if one
trigger a singleclick event) wants to listen for both singleclicks and doubleclicks, since it
* <*> original event properties will not trigger a singleclick event)
drag <event> drag * <*> Original event properties
Fires on mousemove after dragstart, stops firing on mouseup drag <!> drag
clientDX <number> horizontal drag delta in px Fires on mousemove after dragstart, stops firing on mouseup
clientDY <number> vertical drag delta in px clientDX <n> Horizontal drag delta in px
* <*> original event properties clientDY <n> Vertical drag delta in px
dragend <event> dragpause * <*> Original event properties
Fires on mouseup after dragstart dragend <!> dragpause
clientDX <number> horizontal drag delta in px Fires on mouseup after dragstart
clientDY <number> vertical drag delta in px clientDX <n> Horizontal drag delta in px
* <*> original event properties clientDY <n> Vertical drag delta in px
dragenter <event> dragenter * <*> Original event properties
Fires when entering an element during drag (this fires on the element dragenter <!> dragenter
being dragged -- the target element is the event's target property) Fires when entering an element during drag (this fires on the
clientDX <number> horizontal drag delta in px element being dragged -- the target element is the event's target
clientDY <number> vertical drag delta in px property)
* <*> original event properties clientDX <n> Horizontal drag delta in px
dragleave <event> dragleave clientDY <n> Vertical drag delta in px
Fires when leaving an element during drag (this fires on the element * <*> Original event properties
being dragged -- the target element is the event's target property) dragleave <!> dragleave
clientDX <number> horizontal drag delta in px Fires when leaving an element during drag (this fires on the element
clientDY <number> vertical drag delta in px being dragged -- the target element is the event's target property)
* <*> original event properties clientDX <n> Horizontal drag delta in px
dragpause <event> dragpause clientDY <n> Vertical drag delta in px
Fires once when the mouse doesn't move for 250 ms during drag (this is * <*> Original event properties
useful in order to execute operations that are too expensive to be dragpause <!> dragpause
attached to the drag event) Fires once when the mouse doesn't move for 250 ms during drag (this
clientDX <number> horizontal drag delta in px is useful in order to execute operations that are too expensive to
clientDY <number> vertical drag delta in px be attached to the drag event)
* <*> original event properties clientDX <n> Horizontal drag delta in px
mousedown <event> mousedown clientDY <n> Vertical drag delta in px
Fires on mousedown (this is useful if one wants to listen for * <*> Original event properties
singleclicks, but not doubleclicks or drag events, and wants the event mousedown <!> mousedown
to fire as early as possible) Fires on mousedown (this is useful if one wants to listen for
* <*> original event properties singleclicks, but not doubleclicks or drag events, and wants the
dragstart <event> dragstart event to fire as early as possible)
Fires when the mouse is down for 250 ms * <*> Original event properties
* <*> original event properties dragstart <!> dragstart
mouserepeat <event> mouserepeat Fires when the mouse is down for 250 ms
Fires every 50 ms after the mouse was down for 250 ms, stops firing on * <*> Original event properties
mouseleave or mouseup (this fires like a key that is being pressed and mouserepeat <!> mouserepeat
held, and is useful for buttons like scrollbars arrows that need to Fires every 50 ms after the mouse was down for 250 ms, stops firing
react to both clicking and holding) on mouseleave or mouseup (this fires like a key that is being
singleclick <event> singleclick pressed and held, and is useful for buttons like scrollbars arrows
Fires 250 ms after mouseup, if there was no subsequent mousedown (this that need to react to both clicking and holding)
is useful if one wants to listen for both singleclicks and doubleclicks, singleclick <!> singleclick
since it will not fire for doubleclicks) Fires 250 ms after mouseup, if there was no subsequent mousedown
* <*> original event properties (this is useful if one wants to listen for both singleclicks and
@*/ doubleclicks, since it will not fire for doubleclicks)
* <*> Original event properties
*/
Ox.Element = function(options, self) { Ox.Element = function(options, self) {

View file

@ -6,13 +6,13 @@ Ox.JQueryElement <f> Wrapper for jQuery
$element <o> jQuery DOM Element $element <o> jQuery DOM Element
@*/ @*/
Ox.JQueryElement = function($element) { Ox.JQueryElement = function($element) {
//@ id <number> Unique id //@ id <n> Unique id
this.oxid = Ox.uid(); this.oxid = Ox.uid();
//@ $element <object> The jQuery-wrapped DOM element //@ $element <o> The jQuery-wrapped DOM element
this.$element = $element.data({oxid: this.oxid}); this.$element = $element.data({oxid: this.oxid});
//@ 0 <element> The DOM element (for compatibility with jQuery) //@ 0 <h> The DOM element (for compatibility with jQuery)
this[0] = this.$element[0]; this[0] = this.$element[0];
//@ length <number> 1 (for compatibility with jQuery) //@ length <n> 1 (for compatibility with jQuery)
this.length = 1; this.length = 1;
Ox.UI.elements[this.oxid] = this; Ox.UI.elements[this.oxid] = this;
return this; return this;