Skip to content

Commit 63c28e4

Browse files
author
Henrik jJaven
committed
Removed timer
1 parent b9d1332 commit 63c28e4

File tree

1 file changed

+9
-39
lines changed

1 file changed

+9
-39
lines changed

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

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie"
88

99
const lenA = adjectives.length, lenB = colours.length, lenC = nouns.length
1010

11-
import Timer from './doo.timer.js'
12-
1311
Doo.define(
1412
class Main extends Doo {
1513
constructor() {
@@ -29,8 +27,7 @@ Doo.define(
2927
this.addEventListeners()
3028
this.selectedRow = undefined
3129
document.querySelector(".ver").innerHTML += ` ${Doo.version} (non-keyed)`
32-
document.title += ` ${Doo.version} (non-keyed)`
33-
}
30+
document.title += ` ${Doo.version} (non-keyed)` }
3431

3532
async dooAfterRender() {
3633
this.tbody = this.shadow.querySelector('#tbody')
@@ -76,52 +73,25 @@ Doo.define(
7673
}
7774

7875
}
79-
run(e) {
80-
Timer.start('tot')
81-
this.data.rows = this.buildData()
82-
if (this.tbody.childNodes.length > this.data.rows.length) {
83-
this.tbody.textContent = ''
84-
}
85-
this.renderTable()
86-
// e.target.blur()
87-
Timer.stop('tot')
88-
}
8976

90-
add(e) {
91-
Timer.start('tot')
77+
add() {
9278
let startRow = this.data.rows.length
9379
this.data.rows = this.data.rows.concat(this.buildData())
9480
this.renderTable(this.data.rows, startRow)
95-
Timer.stop('tot')
96-
9781
}
9882

99-
100-
runLots(e) {
101-
this.data.rows = this.buildData(10000)
102-
if (this.tbody.childNodes.length > this.data.rows.length) {
103-
this.tbody.textContent = ''
104-
}
105-
this.renderTable()
106-
}
107-
108-
runLots(e) {
109-
Timer.start('tot')
83+
runLots() {
11084
this.data.rows = this.buildData(10000)
11185
if (this.tbody.childNodes.length > this.data.rows.length) {
11286
this.tbody.textContent = ''
11387
}
11488
this.renderTable()
115-
// e.target.blur()
116-
Timer.stop('tot')
11789
}
11890

119-
update(e) {
120-
Timer.start('tot')
91+
update() {
12192
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
12293
this.tbody.childNodes[i].childNodes[1].childNodes[0].innerText = this.data.rows[i].label += ' !!!'
12394
}
124-
Timer.stop('tot')
12595
}
12696

12797
select(elem) {
@@ -159,17 +129,17 @@ Doo.define(
159129
document.getElementById("main").addEventListener('click', e => {
160130
e.preventDefault();
161131
if (e.target.matches('#runlots')) {
162-
this.runLots(e);
132+
this.runLots();
163133
} else if (e.target.matches('#run')) {
164-
this.run(e);
134+
this.run();
165135
} else if (e.target.matches('#add')) {
166-
this.add(e);
136+
this.add();
167137
} else if (e.target.matches('#update')) {
168-
this.update(e);
138+
this.update();
169139
} else if (e.target.matches('#clear')) {
170140
this.clear();
171141
} else if (e.target.matches('#swaprows')) {
172-
this.swapRows(e);
142+
this.swapRows();
173143
}
174144
})
175145
}

0 commit comments

Comments
 (0)