Skip to content

Commit

Permalink
updated: cleaning up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jun 9, 2015
1 parent dc3c339 commit b569632
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/browser/tag/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function Tag(impl, conf, innerHTML) {
self.trigger('premount')

if (isLoop) {
// update the root attribute for the looped elements
self.root = root = loopDom = dom.firstChild
} else {
while (dom.firstChild) root.appendChild(dom.firstChild)
Expand Down
4 changes: 2 additions & 2 deletions test/performance/loop.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
})

var items = []
for ( var i = 0; i < 5; i++ ) {
for ( var i = 0; i < 10000; i++ ) {
items.push( { value: i } )
}
var tag = riot.mount('*', { items: items } )[0],
headings = tag.root.querySelectorAll('h2')

for ( var i = 0; i < 5; i++ ) {
for ( var i = 0; i < 10000; i++ ) {
headings[i].classList.add('nr-' + i)
}

Expand Down

0 comments on commit b569632

Please sign in to comment.