From 2caa6eba91f9c810bda3087d521771b0b9e013f2 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 8 Oct 2024 10:27:47 +0800 Subject: fix: only show "More" with renderer suggestions in menu --- src/editor.mjs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/editor.mjs') diff --git a/src/editor.mjs b/src/editor.mjs index 29e7052..d75d1ec 100644 --- a/src/editor.mjs +++ b/src/editor.mjs @@ -193,7 +193,6 @@ const editor = new EasyMDE({ const cm = editor.codemirror - const getRefLinks = () => editor.value() .split('\n') .map(line => { @@ -779,13 +778,13 @@ const getSuggestions = anchor => { return rendererSuggestions.length === 0 ? [] : [ - ...rendererSuggestions, - new menuItem.Item({ - innerHTML: 'More...', - className: ['suggestion'], - onclick: () => window.open('https://github.com/outdoorsafetylab/mapclay#renderer', '_blank') - }) - ] + ...rendererSuggestions, + new menuItem.Item({ + innerHTML: 'More...', + className: ['suggestion'], + onclick: () => window.open('https://github.com/outdoorsafetylab/mapclay#renderer', '_blank') + }) + ] } return [] } @@ -940,7 +939,7 @@ const addMapRandomlyByPreset = () => { const yamlText = [ 'apply: dist/default.yml', 'width: 85%', - 'height: 200px', + 'height: 200px' ] const order = [ 'id', @@ -954,8 +953,8 @@ const addMapRandomlyByPreset = () => { ] const aliasesEntries = Object.entries(aliasesForMapOptions) .filter(([key, _]) => - order.includes(key) - && !yamlText.find(text => text.startsWith(key)) + order.includes(key) && + !yamlText.find(text => text.startsWith(key)) ) if (aliasesEntries.length === 0) return -- cgit v1.2.3-70-g09d2