diff options
| author | Misko Hevery | 2010-04-22 22:44:48 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-04-22 22:44:48 -0700 | 
| commit | 0396054b4a420972e16d0d9e965eb51ecd6f86a2 (patch) | |
| tree | 5c30a4c2058e3ed112ae7507c4d9bbd417e49c2d | |
| parent | 5fdb117b32b72a908a3938bee8f1bce9854a0004 (diff) | |
| download | angular.js-0396054b4a420972e16d0d9e965eb51ecd6f86a2.tar.bz2 | |
fixed the way IE breaks parests on innerHTML
| -rw-r--r-- | src/jqLite.js | 8 | ||||
| -rw-r--r-- | src/widgets.js | 5 | ||||
| -rwxr-xr-x | test.sh | 2 | 
3 files changed, 9 insertions, 6 deletions
| diff --git a/src/jqLite.js b/src/jqLite.js index 18589630..134c1e17 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -211,11 +211,9 @@ JQLite.prototype = {    html: function(value) {      if (isDefined(value)) { -      var parent = this[0], child; -      while(parent.childNodes.length) { -        child = parent.childNodes[0]; -        jqLite(child).dealoc(); -        parent.removeChild(child); +      var i = 0, childNodes = this[0].childNodes; +      for ( ; i < childNodes.length; i++) { +        jqLite(childNodes[i]).dealoc();        }        this[0].innerHTML = value;      } diff --git a/src/widgets.js b/src/widgets.js index 209b24b7..8a816934 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -239,6 +239,11 @@ var ngSwitch = angularWidget('NG:SWITCH', function (element){      }    }); +  // this needs to be here for IE +  foreach(cases, function(_case){ +    _case.element.remove(); +  }); +    element.html('');    return function(element){      var scope = this, childScope; @@ -1,2 +1,2 @@  # java -jar lib/jstestdriver/JsTestDriver.jar --tests all -java -jar lib/jstestdriver/JsTestDriver.jar --tests all --config jsTestDriver-jquery.conf +java -jar lib/jstestdriver/JsTestDriver.jar --tests 'widget ng:switch' --config jsTestDriver-jquery.conf | 
