diff options
| author | Misko Hevery | 2011-02-10 11:20:49 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-02-16 08:59:42 -0500 |
| commit | 00cc9eb32a9387040d0175fcfd21cf9dcab6514f (patch) | |
| tree | 0edaac339a3ec69ff769e20b28b6ebe51d040272 /src/Angular.js | |
| parent | ef4bb28be13e99f96c9ace5936cf26a174a0e5f0 (diff) | |
| download | angular.js-00cc9eb32a9387040d0175fcfd21cf9dcab6514f.tar.bz2 | |
rewrite of JQuery lite implementation, which now better supports selected sets
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/src/Angular.js b/src/Angular.js index 9eaeb093..99a4528d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -268,24 +268,6 @@ function extensionMap(angular, name, transform) { }); } -function jqLiteWrap(element) { - // for some reasons the parentNode of an orphan looks like _null but its typeof is object. - if (element) { - if (isString(element)) { - var div = document.createElement('div'); - // Read about the NoScope elements here: - // http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx - div.innerHTML = '<div> </div>' + element; // IE insanity to make NoScope elements work! - div.removeChild(div.firstChild); // remove the superfluous div - element = new JQLite(div.childNodes); - } else if (!(element instanceof JQLite)) { - element = new JQLite(element); - } - } - return element; -} - - /** * @workInProgress * @ngdoc function @@ -422,7 +404,9 @@ function isBoolean(value) { return typeof value == $boolean;} function isTextNode(node) { return nodeName_(node) == '#text'; } function trim(value) { return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; } function isElement(node) { - return node && (node.nodeName || node instanceof JQLite || (jQuery && node instanceof jQuery)); + return node && + (node.nodeName // we are a direct element + || (node.bind && node.find)); // we have a bind and find method part of jQuery API } /** @@ -1057,11 +1041,11 @@ function bindJQuery(){ // bind to jQuery if present; jQuery = window.jQuery; // reset to jQuery or default to us. - if (window.jQuery) { - jqLite = window.jQuery; - extend(jqLite.fn, { - scope: JQLite.prototype.scope, - cloneNode: cloneNode + if (jQuery) { + jqLite = jQuery; + extend(jQuery.fn, { + scope: JQLitePrototype.scope, + cloneNode: JQLitePrototype.cloneNode }); } else { jqLite = jqLiteWrap; |
