Simplified event module, added event module documentation
This commit is contained in:
parent
15d1d3d4ac
commit
a41e850db9
15
README.md
15
README.md
@ -44,7 +44,7 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
|
|||||||
|
|
||||||
**Store**: localstorage wrapper with automatic data serialization
|
**Store**: localstorage wrapper with automatic data serialization
|
||||||
|
|
||||||
functions
|
functions:
|
||||||
|
|
||||||
* Get:
|
* Get:
|
||||||
Use:
|
Use:
|
||||||
@ -57,6 +57,19 @@ Browser support: IE8+, Latest versions of Firefox, Chrome, Safari, Opera
|
|||||||
* getALL: Retreives all localstorage data in raw form
|
* getALL: Retreives all localstorage data in raw form
|
||||||
Use:
|
Use:
|
||||||
$_.store.getAll();
|
$_.store.getAll();
|
||||||
|
|
||||||
|
|
||||||
|
**Event**: wrapper for applying events to DOM objects
|
||||||
|
|
||||||
|
function:
|
||||||
|
|
||||||
|
*Add:
|
||||||
|
Use:
|
||||||
|
$_.event.add(selector, event, callback);
|
||||||
|
|
||||||
|
*Remove
|
||||||
|
Use:
|
||||||
|
$_.event.remove(selector, event, callback);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
9
kis.js
9
kis.js
@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
for (var name in data)
|
for (var name in data)
|
||||||
{
|
{
|
||||||
if(!data.hasOwnProperty(name)) continue;
|
if(!data.hasOwnProperty(name)){ continue };
|
||||||
if(typeof data[name] === "function") continue;
|
if(typeof data[name] === "function"){ continue };
|
||||||
|
|
||||||
var value = data[name].toString();
|
var value = data[name].toString();
|
||||||
|
|
||||||
@ -242,13 +242,12 @@
|
|||||||
*/
|
*/
|
||||||
(function(){
|
(function(){
|
||||||
var attach, remove;
|
var attach, remove;
|
||||||
var eType = (document.addEventListener) ? "good" : "bad";
|
|
||||||
|
|
||||||
if(eType === "good")
|
if(document.addEventListener)
|
||||||
{
|
{
|
||||||
attach = function(sel, event, callback)
|
attach = function(sel, event, callback)
|
||||||
{
|
{
|
||||||
sel.addEventListener(event, callback, false)
|
sel.addEventListener(event, callback, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
remove = function(sel, event, callback)
|
remove = function(sel, event, callback)
|
||||||
|
Loading…
Reference in New Issue
Block a user