jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans.events
Search:
 
Filters

static Class jsbeans.events

A collection of utilities for managing events

Methods

addHandler

static void addHandler ( element , name , handler )
A way to make DOM Object dinamic attaching functions fired at given event.
Parameters:
element <DOM> the DOM Object on which the events will be fired
name <String> the name of the event (i.e. 'click') without 'on'
handler <Function> the closure fired on given event
Returns: void

bind

static void bind ( element , name , handler )
A way to make DOM Object dinamic attaching functions fired at given event.
Internally it calls jsbeans.events.addHandler
Parameters:
element <DOM> the DOM Object on which the events will be fired
name <String> the name of the event (i.e. 'click') without 'on'
handler <Function> the closure fired on given event
Returns: void

flush

static void flush ( )
Removes all previously attached events.
Returns: void

getEventTarget

static DOM getEventTarget ( event )
Returns the DOM Object attached on given {@param} event
Parameters:
event <event>
Returns: DOM
the DOM Object attached on event

getTarget

static DOM getTarget ( event )
Returns the DOM Object attached on given {@param} event.
Internally it calls jsbeans.events.getEventTarget
Parameters:
event <event>
Returns: DOM
the DOM Object attached on event

removeHandler

static void removeHandler ( element , name , handler )
Removes a previously attached event.
Parameters:
element <DOM> the DOM Object on which the events will be fired
name <String> the name of the event (i.e. 'click') without 'on'
handler <Function> the closure fired on given event
Returns: void

shortcut

static void shortcut ( shortcutName , callback , [options] )
Creates a shortcut, also known as key binding.
FIXME: due to parsing problem it's not possible to bind backslash ('\')
Parameters:
shortcutName <String> the shortcut. Ex.: 'CRTL+U'
callback <Function> the function fired on pressing given shortcutName
[options] <JSON>
propagate: a_boolean, // if true it enables firing other events (it does not call cancelBubble), default false
target: DOM_or_String // a DOM Object (or its id) on which the shortcut will be associated
Returns: void

unbind

static void unbind ( element , name , handler )
Removes a previously attached event.
Internally it calls jsbeans.events.removeHandler
Parameters:
element <DOM> the DOM Object on which the events will be fired
name <String> the name of the event (i.e. 'click') without 'on'
handler <Function> the closure fired on given event
Returns: void


Copyright © 2016 Francesco Mele. All rights reserved.