浏览代码

HUE-3152 [fb] Moving a file doesn’t show the tree if you don’t have the right permissions

Enrico Berti 9 年之前
父节点
当前提交
f89d476f8d
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      desktop/core/src/desktop/static/desktop/js/jquery.hdfstree.js

+ 6 - 2
desktop/core/src/desktop/static/desktop/js/jquery.hdfstree.js

@@ -142,10 +142,11 @@
           currentPath = "";
 
       if (options.paths != null && options.paths.length > 0) {
-        currentPath = options.paths.shift();
+        var shiftedPath = options.paths.shift();
+        currentPath = (shiftedPath != "" ? shiftedPath : "/");
       }
       else {
-        currentPath = (options.leaf != null ? options.leaf : "");
+        currentPath = (options.leaf != null ? options.leaf : "/");
       }
       autocompleteUrl += currentPath;
       $.getJSON(autocompleteUrl + "?pagesize=1000&format=json", function (data) {
@@ -244,6 +245,9 @@
             });
           }
         }
+        else {
+          $.jHueNotify.error(data.error);
+        }
       });
     }