diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/MenuItem.mjs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/MenuItem.mjs b/src/MenuItem.mjs index f5dfb5b..d580cb3 100644 --- a/src/MenuItem.mjs +++ b/src/MenuItem.mjs | |||
| @@ -11,9 +11,10 @@ export class Item extends window.HTMLDivElement { | |||
| 11 | * | 11 | * |
| 12 | * @param {Object} | 12 | * @param {Object} |
| 13 | */ | 13 | */ |
| 14 | constructor ({ text, innerHTML, onclick, style, className }) { | 14 | constructor ({ text, innerHTML, title, onclick, style, className }) { |
| 15 | super() | 15 | super() |
| 16 | this.innerHTML = innerHTML ?? text | 16 | this.innerHTML = innerHTML ?? text |
| 17 | this.title = title | ||
| 17 | this.onclick = onclick | 18 | this.onclick = onclick |
| 18 | this.style.cssText = style | 19 | this.style.cssText = style |
| 19 | this.classList.add('menu-item') | 20 | this.classList.add('menu-item') |
| @@ -377,7 +378,8 @@ export const addRefLink = (cm, refLinks) => | |||
| 377 | new Folder({ | 378 | new Folder({ |
| 378 | text: 'Add Link', | 379 | text: 'Add Link', |
| 379 | items: refLinks.map(refLink => new Item({ | 380 | items: refLinks.map(refLink => new Item({ |
| 380 | text: refLink.ref, | 381 | text: refLink.link.startsWith('geo:') ? `@ ${refLink.ref}` : refLink.ref, |
| 382 | title: refLink.link, | ||
| 381 | onclick: () => { | 383 | onclick: () => { |
| 382 | const selection = cm.getSelection() | 384 | const selection = cm.getSelection() |
| 383 | if (selection === refLink.ref) { | 385 | if (selection === refLink.ref) { |