fixed the way IE breaks parests on innerHTML

This commit is contained in:
Misko Hevery 2010-04-22 22:44:48 -07:00
parent 5fdb117b32
commit 0396054b4a
3 changed files with 9 additions and 6 deletions

View file

@ -211,11 +211,9 @@ JQLite.prototype = {
html: function(value) { html: function(value) {
if (isDefined(value)) { if (isDefined(value)) {
var parent = this[0], child; var i = 0, childNodes = this[0].childNodes;
while(parent.childNodes.length) { for ( ; i < childNodes.length; i++) {
child = parent.childNodes[0]; jqLite(childNodes[i]).dealoc();
jqLite(child).dealoc();
parent.removeChild(child);
} }
this[0].innerHTML = value; this[0].innerHTML = value;
} }

View file

@ -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(''); element.html('');
return function(element){ return function(element){
var scope = this, childScope; var scope = this, childScope;

View file

@ -1,2 +1,2 @@
# java -jar lib/jstestdriver/JsTestDriver.jar --tests all # 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