From f7bf984d681c6e1667d53be4f0112103162279f8 Mon Sep 17 00:00:00 2001 From: Nate B <0nathan0nathan0nathan0+github@gmail.com> Date: Wed, 13 Jul 2011 22:41:34 -0600 Subject: [PATCH] Fix issue #5 --- kis.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kis.js b/kis.js index e7c1489..b6d4666 100644 --- a/kis.js +++ b/kis.js @@ -64,20 +64,23 @@ */ $_ = function(sel) { + // Make a copy before adding properties + var self = dcopy($_); + //Get the DOM objects from the selector sel = $(sel); - + //Have window be default selector, just in case if(typeof sel === "undefined") { - sel = (typeof $_.el !== "undefined") - ? $_.el + sel = (typeof self.el !== "undefined") + ? self.el : window; } - $_.el = sel; + self.el = sel; - return dcopy($_); + return self; }; /**