Переглянути джерело

[core] Avoid double leading slash on hdfs autocomplete paths

Enrico Berti 11 роки тому
батько
коміт
1e4a2c8
1 змінених файлів з 1 додано та 1 видалено
  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() + "/");