diff --git a/kis.js b/kis.js index f02e27c..aff1732 100644 --- a/kis.js +++ b/kis.js @@ -9,7 +9,7 @@ "use strict"; - var $_, $, kis; + var $_, $; $_ = {}; @@ -76,8 +76,8 @@ for (var name in data) { - if(!data.hasOwnProperty(name)){ continue }; - if(typeof data[name] === "function"){ continue }; + if(!data.hasOwnProperty(name)){ continue; }; + if(typeof data[name] === "function"){ continue; }; var value = data[name].toString(); @@ -241,7 +241,7 @@ * Event api wrapper */ (function(){ - var attach, remove; + var attach, remove, add_remove, e; if(document.addEventListener) { @@ -268,44 +268,65 @@ }; } - var e = { + add_remove = function (sel, event, callback, add) + { + var i,len; + + if(!sel) + { + return false; + } + + //Get the DOM object if you give me a selector string + if(typeof sel === "string") + { + sel = $(sel); + } + + //Multiple events? Run recursively! + event = event.split(" "); + + if(event.length > 1) + { + console.log(event); + + len = event.length; + + for(i=0;i 1) + { + len = sel.length; + for(i=0;i