aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/dumbyUtils.mjs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs
index 6a77548..40afbd3 100644
--- a/src/dumbyUtils.mjs
+++ b/src/dumbyUtils.mjs
@@ -218,10 +218,12 @@ export const createGeoLink = (link) => {
218 * @param {HTMLElement} Elements contains anchor elements for doclinks 218 * @param {HTMLElement} Elements contains anchor elements for doclinks
219 */ 219 */
220export const createDocLink = link => { 220export const createDocLink = link => {
221 const label = decodeURIComponent(link.href.split('#')[1])
222 const selector = link.title.split('=>')[1] ?? label ? '#' + label : null
223 if (!selector) return false
224
221 link.classList.add('with-leader-line', 'doclink') 225 link.classList.add('with-leader-line', 'doclink')
222 link.lines = [] 226 link.lines = []
223 const label = decodeURIComponent(link.href.split('#')[1])
224 const selector = link.title.split('=>')[1] ?? '#' + label
225 227
226 link.onmouseover = () => { 228 link.onmouseover = () => {
227 const targets = document.querySelectorAll(selector) 229 const targets = document.querySelectorAll(selector)