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
drag <!> drag
Fires on mousemove after dragstart, stops firing on mouseup Fires on mousemove after dragstart, stops firing on mouseup
clientDX <number> horizontal drag delta in px clientDX <n> Horizontal drag delta in px
clientDY <number> vertical drag delta in px clientDY <n> Vertical drag delta in px
* <*> original event properties * <*> Original event properties
dragend <event> dragpause dragend <!> dragpause
Fires on mouseup after dragstart Fires on mouseup after dragstart
clientDX <number> horizontal drag delta in px clientDX <n> Horizontal drag delta in px
clientDY <number> vertical drag delta in px clientDY <n> Vertical drag delta in px
* <*> original event properties * <*> Original event properties
dragenter <event> dragenter dragenter <!> dragenter
Fires when entering an element during drag (this fires on the element Fires when entering an element during drag (this fires on the
being dragged -- the target element is the event's target property) element being dragged -- the target element is the event's target
clientDX <number> horizontal drag delta in px property)
clientDY <number> vertical drag delta in px clientDX <n> Horizontal drag delta in px
* <*> original event properties clientDY <n> Vertical drag delta in px
dragleave <event> dragleave * <*> Original event properties
dragleave <!> dragleave
Fires when leaving an element during drag (this fires on the element Fires when leaving an element during drag (this fires on the element
being dragged -- the target element is the event's target property) being dragged -- the target element is the event's target property)
clientDX <number> horizontal drag delta in px clientDX <n> Horizontal drag delta in px
clientDY <number> vertical drag delta in px clientDY <n> Vertical drag delta in px
* <*> original event properties * <*> Original event properties
dragpause <event> dragpause dragpause <!> dragpause
Fires once when the mouse doesn't move for 250 ms during drag (this is Fires once when the mouse doesn't move for 250 ms during drag (this
useful in order to execute operations that are too expensive to be is useful in order to execute operations that are too expensive to
attached to the drag event) be attached to the drag event)
clientDX <number> horizontal drag delta in px clientDX <n> Horizontal drag delta in px
clientDY <number> vertical drag delta in px clientDY <n> Vertical drag delta in px
* <*> original event properties * <*> Original event properties
mousedown <event> mousedown mousedown <!> mousedown
Fires on mousedown (this is useful if one wants to listen for Fires on mousedown (this is useful if one wants to listen for
singleclicks, but not doubleclicks or drag events, and wants the event singleclicks, but not doubleclicks or drag events, and wants the
to fire as early as possible) event to fire as early as possible)
* <*> original event properties * <*> Original event properties
dragstart <event> dragstart dragstart <!> dragstart
Fires when the mouse is down for 250 ms Fires when the mouse is down for 250 ms
* <*> original event properties * <*> Original event properties
mouserepeat <event> mouserepeat mouserepeat <!> mouserepeat
Fires every 50 ms after the mouse was down for 250 ms, stops firing on Fires every 50 ms after the mouse was down for 250 ms, stops firing
mouseleave or mouseup (this fires like a key that is being pressed and on mouseleave or mouseup (this fires like a key that is being
held, and is useful for buttons like scrollbars arrows that need to pressed and held, and is useful for buttons like scrollbars arrows
react to both clicking and holding) that need to react to both clicking and holding)
singleclick <event> singleclick singleclick <!> singleclick
Fires 250 ms after mouseup, if there was no subsequent mousedown (this Fires 250 ms after mouseup, if there was no subsequent mousedown
is useful if one wants to listen for both singleclicks and doubleclicks, (this is useful if one wants to listen for both singleclicks and
since it will not fire for doubleclicks) doubleclicks, since it will not fire for doubleclicks)
* <*> original event properties * <*> 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;