Explorar o código

[core] Avoid double leading slash on hdfs autocomplete paths

Enrico Berti %!s(int64=11) %!d(string=hai) anos
pai
achega
1e4a2c8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      desktop/core/static/js/jquery.hdfsautocomplete.js

+ 1 - 1
desktop/core/static/js/jquery.hdfsautocomplete.js

@@ -238,7 +238,7 @@
                 _el.val(path.substring(0, path.lastIndexOf("/")));
               }
               else {
-                _el.val(path + "/" + item);
+                _el.val(path + (path.charAt(path.length - 1) == "/" ? "" : "/") + item);
               }
               if ($(this).html().indexOf("folder") > -1) {
                 _el.val(_el.val() + "/");