Skip to content

Commit 19f82a6

Browse files
author
Henrik jJaven
committed
DooHTML-keyed-reverted-to-v0.30.8-with-minor-mods
1 parent 9cf9047 commit 19f82a6

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,20 @@ Doo.define(
7979
}
8080

8181
run() {
82-
this.clear()
8382
this.data.rows = this.buildData()
83+
this.tbody.textContent = ''
8484
this.renderTable()
85-
8685
}
8786

8887
add() {
88+
let startRow = this.data.rows.length
8989
this.data.rows = this.data.rows.concat(this.buildData())
90-
this.renderTable(this.data.rows)
90+
this.appendData(this.tbody, startRow)
9191
}
9292

9393
runLots() {
94-
this.clear()
9594
this.data.rows = this.buildData(10000)
95+
this.tbody.textContent = ''
9696
this.renderTable()
9797
}
9898

@@ -106,16 +106,12 @@ Doo.define(
106106
if (this.selectedRow) {
107107
this.selectedRow.classList.remove('danger')
108108
this.selectedRow = undefined
109+
// return should toggle IMO
109110
}
110-
this.toggleSelect(this.getParentRow(elem))
111-
}
112-
113-
toggleSelect(row) {
111+
let row = this.getParentRow(elem)
114112
if (row) {
115113
row.classList.toggle('danger')
116-
if (row.classList.contains('danger')) {
117-
this.selectedRow = row
118-
}
114+
this.selectedRow = row
119115
}
120116
}
121117

@@ -129,7 +125,7 @@ Doo.define(
129125
let node1 = this.tbody.childNodes[1]
130126
let node2 = this.tbody.childNodes[998]
131127

132-
let row1 = this.data.rows[1]
128+
let row1 = this.data.rows[1];
133129
this.data.rows[1] = this.data.rows[998]
134130
this.data.rows[998] = row1
135131

frameworks/keyed/doohtml/js/doo.html.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/doohtml/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-framework-benchmark-doohtml",
3-
"version": "0.60.3",
3+
"version": "0.30.8",
44
"description": "DooHTML JS-Benchmark",
55
"main": "Main.class.js",
66
"js-framework-benchmark": {

frameworks/keyed/doohtml/templates/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<template>
33
<table class="table table-hover table-striped test-data">
44
<link href="${link}" rel="stylesheet">
5-
<tbody id="tbody"><tr bind="rows"><td class="col-md-1">{{id}}</td><td class="col-md-4"><a>{{label}}</a></td><td class="col-md-1"><a class="remove"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td><td class="col-md-6"></td></tr></tbody>
5+
<tbody id="tbody"><tr bind="rows" key="{{id}}"><td class="col-md-1">{{id}}</td><td class="col-md-4"><a>{{label}}</a></td><td class="col-md-1"><a class="remove"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td><td class="col-md-6"></td></tr></tbody>
66
</table>
77
</template>

0 commit comments

Comments
 (0)