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

View file

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