(targetElementSelector, entryName, entryFunction)
| 40 | } |
| 41 | |
| 42 | function appendContextMenuOption(targetElementSelector, entryName, entryFunction) { |
| 43 | var currentItems = menuSpecs.get(targetElementSelector); |
| 44 | |
| 45 | if (!currentItems) { |
| 46 | currentItems = []; |
| 47 | menuSpecs.set(targetElementSelector, currentItems); |
| 48 | } |
| 49 | let newItem = { |
| 50 | id: targetElementSelector + "_" + uid(), |
| 51 | name: entryName, |
| 52 | func: entryFunction, |
| 53 | isNew: true |
| 54 | }; |
| 55 | |
| 56 | currentItems.push(newItem); |
| 57 | return newItem["id"]; |
| 58 | } |
| 59 | |
| 60 | function addContextMenuEventListener() { |
| 61 | if (eventListenerApplied) { |
| 62 | return; |
no test coverage detected