ソースを参照

minor fix in disallowing items arrange over task bar

vineethvk11 1 年間 前
コミット
17a82f316d
1 ファイル変更2 行追加9 行削除
  1. 2 9
      src/UI/UIItem.js

+ 2 - 9
src/UI/UIItem.js

@@ -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