aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/MenuItem.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-26 00:30:00 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-26 15:15:51 +0800
commit30509b9bb858fa443fbb5b3d909278957b458c61 (patch)
tree04c2ba9015351ef60c7fc5480c117a39809c6a76 /src/MenuItem.mjs
parent2a2acc8e31aef538a8e68e6b53cacafb38841c26 (diff)
feat: add menu item to change path of leader-line
Diffstat (limited to 'src/MenuItem.mjs')
-rw-r--r--src/MenuItem.mjs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/MenuItem.mjs b/src/MenuItem.mjs
index 4769817..7c617cc 100644
--- a/src/MenuItem.mjs
+++ b/src/MenuItem.mjs
@@ -474,3 +474,22 @@ export const setGeoLinkType = (link) => new Folder({
474 }) 474 })
475 }), 475 }),
476}) 476})
477
478/**
479 * set type of leader-line
480 *
481 * @param {GeoLink | DocLink} link
482 */
483export const setLeaderLineType = (link) => new Folder({
484 text: 'Line Type',
485 items: ['magnet', 'straight', 'grid', 'fluid']
486 .map(path => new Item({
487 text: path,
488 className: ['keep-menu'],
489 onclick: () => {
490 link.dataset.linePath = path
491 removeLeaderLines(link)
492 link.onmouseover()
493 },
494 })),
495})