Merge pull request #162 from vineeth-vk11/fix#114

minor fix in disallowing items arrange over task bar
This commit is contained in:
Nariman Jelveh
2024-03-22 21:59:15 -07:00
committed by GitHub
+2 -9
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