mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-24 06:50:22 +08:00
Fix the issue with context submenu not closing parent menu when clicked
This commit is contained in:
parent
faa72fd97c
commit
a3ec7bb5ad
@ -135,8 +135,8 @@ function UIContextMenu(options){
|
|||||||
$('.context-menu').not(contextMenu).removeClass('context-menu-active');
|
$('.context-menu').not(contextMenu).removeClass('context-menu-active');
|
||||||
|
|
||||||
let cancel_options_ = null;
|
let cancel_options_ = null;
|
||||||
const fade_remove = () => {
|
const fade_remove = (item) => {
|
||||||
$(`#context-menu-${menu_id}, .context-menu[data-element-id="${$(this).closest('.context-menu').attr('data-parent-id')}"]`).fadeOut(200, function(){
|
$(`#context-menu-${menu_id}, .context-menu[data-element-id="${$(item).closest('.context-menu').attr('data-parent-id')}"]`).fadeOut(200, function(){
|
||||||
$(contextMenu).remove();
|
$(contextMenu).remove();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -159,7 +159,7 @@ function UIContextMenu(options){
|
|||||||
}
|
}
|
||||||
// close menu and, if exists, its parent
|
// close menu and, if exists, its parent
|
||||||
if(!$(this).hasClass('context-menu-item-submenu')){
|
if(!$(this).hasClass('context-menu-item-submenu')){
|
||||||
fade_remove();
|
fade_remove(this);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user