Skip to content

Commit 602701c

Browse files
committed
Merge branch 'DooHTML-non-keyed-v0.60.1' of https://github.com/hman61/js-framework-benchmark into hman61-DooHTML-non-keyed-v0.60.1
2 parents cd9bb69 + 77b7742 commit 602701c

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

frameworks/non-keyed/doohtml/index.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
5-
<title>DooHTML</title>
6-
<link href="/css/currentStyle.css" rel="preload" as="style"/>
7-
<link href="/css/currentStyle.css" rel="stylesheet"/>
8-
<link href="./js/doo.html.min.js" rel="preload" as="script"/>
9-
<script src="./js/doo.html.min.js"></script>
10-
11-
<script type="module" src="./js/Main.class.js" defer ></script>
4+
<meta charset="UTF-8">
5+
<title>DooHTML</title>
6+
<link href="/css/currentStyle.css" rel="preload" as="style"/>
7+
<link href="/css/currentStyle.css" rel="stylesheet"/>
8+
<link href="./js/doo.html.min.js" rel="preload" as="script"/>
9+
<script src="./js/doo.html.min.js"></script>
10+
<script type="module" src="./js/Main.class.js" defer ></script>
1211
</head>
1312
<body>
1413
<div id="main">

frameworks/non-keyed/doohtml/js/Main.class.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Doo.define(
2727
this.addEventListeners()
2828
this.selectedRow = undefined
2929
document.querySelector(".ver").innerHTML += ` ${Doo.version} (non-keyed)`
30-
document.title += ` ${Doo.version} (non-keyed)`
31-
}
30+
document.title += ` ${Doo.version} (non-keyed)` }
3231

3332
async dooAfterRender() {
3433
this.tbody = this.shadow.querySelector('#tbody')
@@ -68,25 +67,30 @@ Doo.define(
6867

6968
run() {
7069
this.data.rows = this.buildData()
70+
if (this.tbody.childNodes.length > this.data.rows.length) {
71+
this.tbody.textContent = ''
72+
}
7173
this.renderTable()
74+
7275
}
7376

7477
add() {
7578
let startRow = this.data.rows.length
7679
this.data.rows = this.data.rows.concat(this.buildData())
7780
this.renderTable(this.data.rows, startRow)
78-
}
81+
}
7982

8083
runLots() {
8184
this.data.rows = this.buildData(10000)
85+
if (this.tbody.childNodes.length > this.data.rows.length) {
86+
this.tbody.textContent = ''
87+
}
8288
this.renderTable()
8389
}
8490

8591
update() {
86-
let tr = this.tbody.querySelectorAll('tr')
8792
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
88-
this.data.rows[i].label += ' !!!';
89-
tr[i].childNodes[1].childNodes[0].textContent = this.data.rows[i].label
93+
this.tbody.childNodes[i].childNodes[1].childNodes[0].innerText = this.data.rows[i].label += ' !!!'
9094
}
9195
}
9296

@@ -118,7 +122,6 @@ Doo.define(
118122

119123
this.tbody.insertBefore(node2, node1)
120124
this.tbody.insertBefore(node1, this.tbody.childNodes[999])
121-
122125
}
123126
}
124127

0 commit comments

Comments
 (0)