window.navtreeitem_edit_popup = new class { init() { const $sysmap = jQuery('#sysmapid'); const name_input = document.getElementById('name'); $sysmap.on('change', () => { if (name_input.value === '') { const sysmaps = $sysmap.multiSelect('getData'); name_input.value = sysmaps.length ? sysmaps[0]['name'] : ''; } }); } };