SovietJS
- Standalone UI event delegate implementation
- Provide multiple styles/modes: override, automatically preventDefault, partial matching, exact matching...
Usage
AMD and OzJS
- SovietJS can either be viewed as an independent library, or as a part of OzJS mirco-framework.
- It's wrapped as an AMD (Asynchronous Module Definition) module. You should use it with oz.js (or require.js or similar for handling dependencies).
- If you want to make it available for both other AMD code and traditional code based on global namespace. OzJS provides a mini define/require implementation to transform AMD module into traditional module pattern.
- See http://ozjs.org for details.
Get the code
Add to your project as new dependency
Or download directly from Github
Dependencies
- mo/lang/es5
- mo/lang/mix
- mo/lang/type
- mo/lang/struct
- dollar or other jQuery-compatible library
Examples
Under construction...
API and usage
var soviet = require('soviet');-
soviet(elm/*, options */)--- options:
-
preventDefault-- false -
matchesSelector-- false -
autoOverride-- false -
aliasEvents-- {} -
trace-- false -
traceStack-- null
-
- API:
-
on(event/*, selector */, handler)-- -
on(event, { 'selector': handler, ... })-- -
off(event, selector, handler)-- -
matches(event, selector)-- -
reset(event)-- -
disable(event, selector)-- -
enable(event, selector)-- -
trigger(ev)--
-
- options:
-
soviet.Soviet--
Under construction...
More References
Release History
License
Copyright (c) 2010 - 2013 dexteryy
Licensed under the MIT license.