fixed what I broke in the last commit ^^;

This commit is contained in:
Timothy Warren 2011-07-11 13:56:23 -04:00
parent f3963925a3
commit 32db8c04c6

13
kis.js
View File

@ -49,10 +49,6 @@
{ {
x = document.getElementsByTagName(a); x = document.getElementsByTagName(a);
} }
else if(a.match(/^\.([\w\-]+)$/) && document.getElementsByClassName !== "undefined")
{
x = document.getElementsByClassName(a);
}
else else
{ {
x = document.querySelectorAll(a); x = document.querySelectorAll(a);
@ -87,6 +83,7 @@
//Set global variables //Set global variables
$_ = window.$_ = window.$_ || $_; $_ = window.$_ = window.$_ || $_;
$_.$ = $;
//console.log polyfill //console.log polyfill
if(typeof window.console === "undefined") if(typeof window.console === "undefined")
@ -156,9 +153,7 @@
var type = (isPost) ? "POST" : "GET"; var type = (isPost) ? "POST" : "GET";
var d = (data.length > 0) ? "?"+this._serialize(data, true) : ''; url += (type === "GET") ? "?"+this._serialize(data, true) : '';
url += (type === "GET") ? d : '';
request.open(type, url); request.open(type, url);
@ -369,14 +364,14 @@
{ {
attach = function (sel, event, callback) attach = function (sel, event, callback)
{ {
if (typeof sel.addEventListener === "function") if (typeof sel.addEventListener !== "undefined")
{ {
sel.addEventListener(event, callback, false); sel.addEventListener(event, callback, false);
} }
}; };
remove = function (sel, event, callback) remove = function (sel, event, callback)
{ {
if (typeof sel.removeEventListener === "function") if (typeof sel.removeEventListener !== "undefined")
{ {
sel.removeEventListener(event, callback, false); sel.removeEventListener(event, callback, false);
} }