aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-07 17:44:30 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-08 10:28:47 +0800
commitb761821e1ad50b42c92e1bbb7926bed3f3195fac (patch)
tree54a08e3916e2fdd3d7f3a2a62da9087ae1c7baa6 /src
parent31106909f6075a139e481df5d929fee3dedfbabf (diff)
fix: only show "More" with renderer suggestions in menu
Diffstat (limited to 'src')
-rw-r--r--src/editor.mjs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index eb9b5c1..29e7052 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -776,14 +776,16 @@ const getSuggestions = anchor => {
776 cm 776 cm
777 }) 777 })
778 ) 778 )
779 return [ 779 return rendererSuggestions.length === 0
780 ...(rendererSuggestions ?? []), 780 ? []
781 new menuItem.Item({ 781 : [
782 innerHTML: '<a href="https://github.com/outdoorsafetylab/mapclay#renderer" class="external" style="display: block;">More...</a>', 782 ...rendererSuggestions,
783 className: ['suggestion'], 783 new menuItem.Item({
784 onclick: () => window.open('https://github.com/outdoorsafetylab/mapclay#renderer', '_blank') 784 innerHTML: '<a href="https://github.com/outdoorsafetylab/mapclay#renderer" class="external" style="display: block;">More...</a>',
785 }) 785 className: ['suggestion'],
786 ] 786 onclick: () => window.open('https://github.com/outdoorsafetylab/mapclay#renderer', '_blank')
787 })
788 ]
787 } 789 }
788 return [] 790 return []
789} 791}