File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,13 @@ <h2>LOCAL TAPAS</h2>
4545 }
4646
4747 function populateList ( plates = [ ] , platesList ) {
48- platesList . innerHTML = plates . map ( ( plate , i ) => {
49- return `
50- <li>
51- <input type="checkbox" data-index=${ i } id="item${ i } " ${ plate . done ? 'checked' : '' } />
52- <label for="item${ i } ">${ plate . text } </label>
53- </li>
54- ` ;
55- } ) . join ( '' ) ;
48+ //once insert a node
49+ if ( platesList . childNodes [ 1 ] . textContent === 'Loading Tapas...' ) {
50+ platesList . removeChild ( platesList . childNodes [ 1 ] )
51+ }
52+ const plate = document . createElement ( 'li' )
53+ plate . innerHTML = `<label>${ plates [ plates . length - 1 ] . text } </label>`
54+ platesList . appendChild ( plate )
5655 }
5756
5857 function toggleDone ( e ) {
@@ -74,4 +73,3 @@ <h2>LOCAL TAPAS</h2>
7473
7574</ body >
7675</ html >
77-
You can’t perform that action at this time.
0 commit comments