Skip to content

Commit a90f275

Browse files
committed
Merge branch 'DooHTML-DOM-v0.92.2-beta-september-21-2024' of https://github.com/hman61/js-framework-benchmark into hman61-DooHTML-DOM-v0.92.2-beta-september-21-2024
2 parents adeefc0 + 1814e0a commit a90f275

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const lenA = adjectives.length, lenB = colours.length, lenC = nouns.length
99
const DEFAULT_SIZE = 1000
1010
const CHILD_1 = 1
1111
const CHILD_998 = 998
12+
const BANG = ' !!!'
1213
const DANGER = 'danger'
1314
Doo.define(
1415
class Main extends Doo {
@@ -58,6 +59,9 @@ Doo.define(
5859
}
5960
return data
6061
}
62+
getIndex(row) {
63+
return this.data.rows.findIndex((item) => item.id === row.key)
64+
}
6165

6266
delete(elem) {
6367
let row = this.getParentRow(elem)
@@ -88,9 +92,8 @@ Doo.define(
8892
}
8993

9094
update() {
91-
const bang = ' !!!'
9295
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
93-
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.textContent = this.data.rows[i].label = `${this.data.rows[i].label}${bang}`
96+
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.nodeValue = this.data.rows[i].label = `${this.data.rows[i].label}${BANG}`
9497
}
9598
}
9699

@@ -101,7 +104,7 @@ Doo.define(
101104
}
102105

103106
if (elem) {
104-
let row = this.getParentRow(elem)
107+
const row = this.getParentRow(elem)
105108
if (row) {
106109
this.selectedRow = row
107110
row.className = DANGER

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ Doo.define(
9292
}
9393

9494
update() {
95-
const bang = ' !!!'
9695
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
9796
this.data.rows[i].label += BANG
98-
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.textContent = this.data.rows[i].label
97+
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.nodeValue = this.data.rows[i].label
9998
}
10099
}
101100

@@ -106,7 +105,7 @@ Doo.define(
106105
}
107106

108107
if (elem) {
109-
let row = this.getParentRow(elem)
108+
const row = this.getParentRow(elem)
110109
if (row) {
111110
this.selectedRow = row
112111
row.className = DANGER

0 commit comments

Comments
 (0)