Skip to content

Commit 18381a8

Browse files
committed
minor improvments
1 parent ddace9b commit 18381a8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Doo.define(
5959
return data
6060
}
6161
getIndex(row) {
62-
return this.data.rows.findIndex((item, i) => item.id === row.key)
62+
return this.data.rows.findIndex((item) => item.id === row.key)
6363
}
6464

6565
delete(elem) {
@@ -92,9 +92,8 @@ Doo.define(
9292
}
9393

9494
update() {
95-
const bang = ' !!!'
9695
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
97-
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}`
9897
}
9998
}
10099

@@ -105,7 +104,7 @@ Doo.define(
105104
}
106105

107106
if (elem) {
108-
let row = this.getParentRow(elem)
107+
const row = this.getParentRow(elem)
109108
if (row) {
110109
this.selectedRow = row
111110
row.className = DANGER
@@ -114,7 +113,7 @@ Doo.define(
114113
}
115114

116115
clear() {
117-
this.tbody.textContent = ''
116+
this.tbody.nodeValue = ''
118117
this.data.rows = []
119118
}
120119

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

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

103103
update() {
104-
const bang = ' !!!'
105104
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
106105
this.data.rows[i].label += BANG
107-
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.textContent = this.data.rows[i].label
106+
this.tbody.childNodes[i].childNodes[1].childNodes[0].firstChild.nodeValue = this.data.rows[i].label
108107
}
109108
}
110109

@@ -124,7 +123,7 @@ Doo.define(
124123
}
125124

126125
clear() {
127-
this.tbody.textContent = ''
126+
this.tbody.nodeValue = ''
128127
this.data.rows = []
129128
}
130129

0 commit comments

Comments
 (0)