diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-01 23:35:36 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-01 23:35:36 +0800 |
commit | 65a4704d5bf5bf44f0ce1a49aa947ff807da0369 (patch) | |
tree | 74db0ad39f88f139f24779b396f494c1a7be39d6 | |
parent | 1cf263317d2f6509b197de78ac6d45f68c7149cd (diff) |
feat: add source code link on top of modal
-rw-r--r-- | src/MenuItem.mjs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/MenuItem.mjs b/src/MenuItem.mjs index d350b45..ff2e432 100644 --- a/src/MenuItem.mjs +++ b/src/MenuItem.mjs | |||
@@ -163,6 +163,9 @@ export const renderResults = ({ modal, modalContent }, map) => | |||
163 | 'relative'; | 163 | 'relative'; |
164 | 164 | ||
165 | modalContent.innerHTML = ''; | 165 | modalContent.innerHTML = ''; |
166 | const sourceCode = document.createElement('div') | ||
167 | sourceCode.innerHTML = `<a href="${map.renderer.url ?? map.renderer.use}">Source Code</a>` | ||
168 | modalContent.appendChild(sourceCode) | ||
166 | const printDetails = result => { | 169 | const printDetails = result => { |
167 | const funcBody = result.func.toString(); | 170 | const funcBody = result.func.toString(); |
168 | const loc = funcBody.split('\n').length; | 171 | const loc = funcBody.split('\n').length; |