Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0396054

Browse files
committed
fixed the way IE breaks parests on innerHTML
1 parent 5fdb117 commit 0396054

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/jqLite.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,9 @@ JQLite.prototype = {
211211

212212
html: function(value) {
213213
if (isDefined(value)) {
214-
var parent = this[0], child;
215-
while(parent.childNodes.length) {
216-
child = parent.childNodes[0];
217-
jqLite(child).dealoc();
218-
parent.removeChild(child);
214+
var i = 0, childNodes = this[0].childNodes;
215+
for ( ; i < childNodes.length; i++) {
216+
jqLite(childNodes[i]).dealoc();
219217
}
220218
this[0].innerHTML = value;
221219
}

src/widgets.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ var ngSwitch = angularWidget('NG:SWITCH', function (element){
239239
}
240240
});
241241

242+
// this needs to be here for IE
243+
foreach(cases, function(_case){
244+
_case.element.remove();
245+
});
246+
242247
element.html('');
243248
return function(element){
244249
var scope = this, childScope;

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# java -jar lib/jstestdriver/JsTestDriver.jar --tests all
2-
java -jar lib/jstestdriver/JsTestDriver.jar --tests all --config jsTestDriver-jquery.conf
2+
java -jar lib/jstestdriver/JsTestDriver.jar --tests 'widget ng:switch' --config jsTestDriver-jquery.conf

0 commit comments

Comments
 (0)