Browse Source

HUE-4625 [fb] S3 filechooser popup do not display the parent directory as ..

Enrico Berti 9 years ago
parent
commit
49ec11d
1 changed files with 8 additions and 1 deletions
  1. 8 1
      desktop/core/src/desktop/static/desktop/js/jquery.filechooser.js

+ 8 - 1
desktop/core/src/desktop/static/desktop/js/jquery.filechooser.js

@@ -260,7 +260,14 @@
             var _flink = $("<a>");
 
             if (file.type == "dir") {
-              _flink.attr("href", "javascript:void(0)").text(" " + (file.name != "" ? file.name : "..")).appendTo(_f);
+              _flink.attr("href", "javascript:void(0)");
+              if (file.path.toLowerCase().indexOf('s3a://') == 0 && (file.path.substr(6).indexOf('/') > -1 || file.path.substr(6) == '')) {
+                _flink.text(" " + (cnt > 0 ? file.name : ".."))
+              }
+              else {
+                _flink.text(" " + (file.name != "" ? file.name : ".."));
+              }
+              _flink.appendTo(_f);
               if (file.path.toLowerCase().indexOf('s3a://') == 0 && file.path.substr(5).indexOf('/') == -1) {
                 $("<i class='fa fa-cloud'></i>").prependTo(_flink);
               }