mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
handle undefined correctly in attrs
This commit is contained in:
parent
d1b310e59c
commit
07120e3ca4
@ -351,13 +351,14 @@ function UIContextMenu(options){
|
|||||||
|
|
||||||
const menu_id = window.global_element_id++;
|
const menu_id = window.global_element_id++;
|
||||||
let h = '';
|
let h = '';
|
||||||
|
console.log(options.parent_id)
|
||||||
h += H`<div
|
h += H`<div
|
||||||
id="context-menu-${menu_id}"
|
id="context-menu-${menu_id}"
|
||||||
data-is-submenu="${options.is_submenu ? 'true' : 'false'}"
|
data-is-submenu="${options.is_submenu ? 'true' : 'false'}"
|
||||||
data-element-id="${menu_id}"
|
data-element-id="${menu_id}"
|
||||||
data-id="${options.id ?? ''}"
|
data-id="${options.id ?? ''}"
|
||||||
${options.parent_id ? `data-parent-id="${options.parent_id}"` : ``}
|
${options.parent_id ? `data-parent-id="${options.parent_id}"` : ``}
|
||||||
${!options.parent_id && options.parent_element ? `data-parent-id="${$(options.parent_element).attr('data-element-id')}"` : ``}
|
${!options.parent_id && $(options.parent_element).attr('data-element-id') !== undefined ? `data-parent-id="${$(options.parent_element).attr('data-element-id')}"` : ``}
|
||||||
class="context-menu context-menu-active ${options.is_submenu ? 'context-menu-submenu-open' : ''}"
|
class="context-menu context-menu-active ${options.is_submenu ? 'context-menu-submenu-open' : ''}"
|
||||||
>`;
|
>`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user