mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 06:00:21 +08:00
When navigating context menu using keyboard skip over item dividers
This commit is contained in:
parent
d6bbba7bf0
commit
706a2403e1
@ -153,7 +153,7 @@ $(document).bind('keydown', async function(e){
|
||||
let selected_item_index = $('.context-menu-active .context-menu-item').index(selected_item);
|
||||
let new_selected_item_index = selected_item_index + 1;
|
||||
let new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
|
||||
while($(new_selected_item).hasClass('context-menu-item-disabled')){
|
||||
while($(new_selected_item).hasClass('context-menu-item-disabled') || $(new_selected_item).hasClass('context-menu-divider')){
|
||||
new_selected_item_index = new_selected_item_index + 1;
|
||||
new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
|
||||
}
|
||||
@ -166,7 +166,7 @@ $(document).bind('keydown', async function(e){
|
||||
let selected_item_index = $('.context-menu-active .context-menu-item').index(selected_item);
|
||||
let new_selected_item_index = selected_item_index - 1;
|
||||
let new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
|
||||
while($(new_selected_item).hasClass('context-menu-item-disabled')){
|
||||
while($(new_selected_item).hasClass('context-menu-item-disabled') || $(new_selected_item).hasClass('context-menu-divider')){
|
||||
new_selected_item_index = new_selected_item_index - 1;
|
||||
new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user