| 24 | } |
| 25 | |
| 26 | addLinks( links = [] ){ |
| 27 | let html = ""; |
| 28 | |
| 29 | /*<div class="flex hover:bg-gray-100 py-1 px-2 rounded cursor-pointer"> |
| 30 | <button class="ml-4" onclick="alert('Delete');">Delete</button> |
| 31 | </div>*/ |
| 32 | |
| 33 | const prefix = '<div class="flex hover:bg-gray-100 py-1 px-2 rounded cursor-pointer"><button class="ml-4" onclick="'; |
| 34 | |
| 35 | links.forEach( link => { |
| 36 | html = `${html + prefix}window.app.${link.code};">${link.name}</button></div>`; |
| 37 | }); |
| 38 | |
| 39 | const elm = document.getElementById("menu-links"); |
| 40 | elm.innerHTML = html; |
| 41 | } |
| 42 | |
| 43 | show(e) { |
| 44 | if (this.menuState !== 1) { |