@@ -83,31 +83,31 @@ class Main {
83
83
84
84
document . getElementById ( "main" ) . addEventListener ( "click" , ( e ) => {
85
85
//console.log("listener",e);
86
- if ( e . target . matches ( "# add") ) {
86
+ if ( e . target . id == " add") {
87
87
e . stopPropagation ( ) ;
88
88
//console.log("add");
89
89
this . add ( ) ;
90
- } else if ( e . target . matches ( "# run") ) {
90
+ } else if ( e . target . id == " run") {
91
91
e . stopPropagation ( ) ;
92
92
//console.log("run");
93
93
this . run ( ) ;
94
- } else if ( e . target . matches ( "# update") ) {
94
+ } else if ( e . target . id == " update") {
95
95
e . stopPropagation ( ) ;
96
96
//console.log("update");
97
97
this . update ( ) ;
98
- } else if ( e . target . matches ( "# runlots") ) {
98
+ } else if ( e . target . id == " runlots") {
99
99
e . stopPropagation ( ) ;
100
100
//console.log("runLots");
101
101
this . runLots ( ) ;
102
- } else if ( e . target . matches ( "# clear") ) {
102
+ } else if ( e . target . id == " clear") {
103
103
e . stopPropagation ( ) ;
104
104
//console.log("clear");
105
105
this . clear ( ) ;
106
- } else if ( e . target . matches ( "# swaprows") ) {
106
+ } else if ( e . target . id == " swaprows") {
107
107
e . stopPropagation ( ) ;
108
108
//console.log("swapRows");
109
109
this . swapRows ( ) ;
110
- } else if ( e . target . matches ( ".remove" ) ) {
110
+ } else if ( e . target . id == ".remove" ) {
111
111
let id = getParentId ( e . target ) ;
112
112
let idx = this . data . findIndex ( ( row ) => row . id === id ) ;
113
113
//console.log("delete",idx);
@@ -166,7 +166,7 @@ class Main {
166
166
// var cNode = tbody.cloneNode(false);
167
167
// tbody.parentNode.replaceChild(cNode ,tbody);
168
168
// ~212 msecs
169
- // this.tbody.textContent = "";
169
+ this . tbody . textContent = "" ;
170
170
171
171
// ~236 msecs
172
172
// var rangeObj = new Range();
@@ -176,9 +176,9 @@ class Main {
176
176
// var last;
177
177
// while (last = tbody.lastChild) tbody.removeChild(last);
178
178
179
- const clone = this . tbody . cloneNode ( ) ;
180
- this . tbody . remove ( ) ;
181
- this . table . insertBefore ( ( this . tbody = clone ) , null ) ;
179
+ // const clone = this.tbody.cloneNode();
180
+ // this.tbody.remove();
181
+ // this.table.insertBefore((this.tbody = clone), null);
182
182
}
183
183
runLots ( ) {
184
184
this . removeAllRows ( ) ;
0 commit comments