minor fix in disallowing items arrange over task bar

This commit is contained in:
vineethvk11 2024-03-23 09:22:11 +05:30
parent 4981d1c490
commit 17a82f316d

View File

@ -345,8 +345,8 @@ function UIItem(options){
// Allow rearranging only if item is on desktop, not trash container, auto arrange is disabled and item is not dropped into another item
if($(el_item).closest('.item-container').attr('data-path') === window.desktop_path &&
!is_auto_arrange_enabled && $(el_item).attr('data-path') !== trash_path && !ui.helper.data('dropped') &&
// Item must be dropped on the Desktop
mouseover_window === undefined){
// Item must be dropped on the Desktop and not on the taskbar
mouseover_window === undefined && ui.position.top <= window.desktop_height - window.taskbar_height - 15){
el_item.style.position = 'absolute';
el_item.style.left = ui.position.left + 'px';
@ -356,13 +356,6 @@ function UIItem(options){
save_desktop_item_positions()
}
// If item is dropped on the taskbar, reset its position
if(ui.position.top >= window.desktop_height - window.taskbar_height) {
el_item.style.position = 'absolute';
el_item.style.left = ui.originalPosition.left + 'px';
el_item.style.top = ui.originalPosition.top + 'px';
}
$('.item-selected-clone').remove();
$('.draggable-count-badge').remove();
// re-enable all droppable UIItems that are not a dir