use reverse loop with deletions

This commit is contained in:
Leo Horie 2014-05-01 22:39:52 -04:00
parent 42a33b074c
commit f28ae323c5
8 changed files with 9 additions and 7 deletions

View file

@ -62,7 +62,7 @@
</div>
<div class="col(9,9,12)">
<h2 id="change-log">Change Log</h2>
<p><a href="/mithril/archive/v0.1.11">v0.1.11</a> - enhancement</p>
<p><a href="/mithril/archive/v0.1.11">v0.1.11</a> - maintenance</p>
<h3 id="news-">News:</h3>
<ul>
<li>Added <code>m.route()</code> overload to allow reading of current route <a href="https://github.com/lhorie/mithril.js/issues/61">#61</a></li>
@ -71,6 +71,7 @@
<h3 id="bug-fixes-">Bug Fixes:</h3>
<ul>
<li>Links using <code>config: m.route</code> can now be opened in new tab correctly <a href="https://github.com/lhorie/mithril.js/issues/64">#64</a></li>
<li>Fixed diff within contenteditable areas <a href="https://github.com/lhorie/mithril.js/issues/65">#65</a></li>
</ul>
<hr>
<p><a href="/mithril/archive/v0.1.10">v0.1.10</a> - maintenance</p>

View file

@ -161,7 +161,7 @@ Mithril = m = new function app(window) {
return cachedAttrs
}
function clear(nodes) {
for (var i = 0; i < nodes.length; i++) nodes[i].parentNode.removeChild(nodes[i])
for (var i = nodes.length - 1; i > -1; i--) nodes[i].parentNode.removeChild(nodes[i])
nodes.length = 0
}
function injectHTML(parentElement, index, data) {

View file

@ -161,7 +161,7 @@ Mithril = m = new function app(window) {
return cachedAttrs
}
function clear(nodes) {
for (var i = 0; i < nodes.length; i++) nodes[i].parentNode.removeChild(nodes[i])
for (var i = nodes.length - 1; i > -1; i--) nodes[i].parentNode.removeChild(nodes[i])
nodes.length = 0
}
function injectHTML(parentElement, index, data) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -1,6 +1,6 @@
## Change Log
[v0.1.11](/mithril/archive/v0.1.11) - enhancement
[v0.1.11](/mithril/archive/v0.1.11) - maintenance
### News:
@ -10,6 +10,7 @@
### Bug Fixes:
- Links using `config: m.route` can now be opened in new tab correctly [#64](https://github.com/lhorie/mithril.js/issues/64)
- Fixed diff within contenteditable areas [#65](https://github.com/lhorie/mithril.js/issues/65)
---

View file

@ -161,7 +161,7 @@ Mithril = m = new function app(window) {
return cachedAttrs
}
function clear(nodes) {
for (var i = 0; i < nodes.length; i++) nodes[i].parentNode.removeChild(nodes[i])
for (var i = nodes.length - 1; i > -1; i--) nodes[i].parentNode.removeChild(nodes[i])
nodes.length = 0
}
function injectHTML(parentElement, index, data) {