@axium/client 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/attachments.ts +2 -1
- package/package.json +1 -1
package/lib/attachments.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface ContextMenuItem {
|
|
|
17
17
|
/**
|
|
18
18
|
* Attach a context menu to an element with the given actions
|
|
19
19
|
*/
|
|
20
|
-
export function contextMenu(...menuItems: ContextMenuItem[]) {
|
|
20
|
+
export function contextMenu(...menuItems: (ContextMenuItem | false | null | undefined)[]) {
|
|
21
21
|
function _attachContextMenu(element: HTMLElement) {
|
|
22
22
|
const menu = document.createElement('div');
|
|
23
23
|
menu.popover = 'auto';
|
|
@@ -26,6 +26,7 @@ export function contextMenu(...menuItems: ContextMenuItem[]) {
|
|
|
26
26
|
const mountedIcons = new Set<Record<string, any>>();
|
|
27
27
|
|
|
28
28
|
for (const item of menuItems) {
|
|
29
|
+
if (!item) continue;
|
|
29
30
|
const div = document.createElement('div');
|
|
30
31
|
div.classList.add('icon-text', 'menu-item');
|
|
31
32
|
if (item.danger) div.classList.add('danger');
|