aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorIgor Minar2011-01-04 17:54:37 -0800
committerIgor Minar2011-01-07 14:39:41 -0800
commit16086aa37c5c0c98f5c4a42d2a15136bb6d18605 (patch)
tree8b8e4b6b585e9d267588cb324745a3246bc5bc41 /src/jqLite.js
parentc0a26b18531482d493d544cf1a207586e8aacaf4 (diff)
downloadangular.js-16086aa37c5c0c98f5c4a42d2a15136bb6d18605.tar.bz2
$location service should utilize onhashchange events instead of polling
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 0d96d6e4..1bc966eb 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -47,14 +47,14 @@ function getStyle(element) {
}
function JQLite(element) {
- if (isElement(element)) {
- this[0] = element;
- this.length = 1;
- } else if (isDefined(element.length) && element.item) {
+ if (!isElement(element) && isDefined(element.length) && element.item) {
for(var i=0; i < element.length; i++) {
this[i] = element[i];
}
this.length = element.length;
+ } else {
+ this[0] = element;
+ this.length = 1;
}
}
@@ -81,7 +81,7 @@ JQLite.prototype = {
dealoc: function(){
(function dealoc(element){
jqClearData(element);
- for ( var i = 0, children = element.childNodes; i < children.length; i++) {
+ for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
dealoc(children[i]);
}
})(this[0]);