Browse Source

HUE-846 [fb] Edit path should support view a file

Inserting a file path now redirects to the file itself
Enlarged the edit path field
Enrico Berti 13 years ago
parent
commit
e73bd31c83

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/fb_components.mako

@@ -49,7 +49,7 @@ from django.utils.translation import ugettext as _
                     <li data-bind="visible: label == '/'"><a href="#" data-bind="click: show"><span class="divider" data-bind="text: label"></span></a></li>
                     <li data-bind="visible: label != '/'"><a href="#" data-bind="text: label, click: show"></a><span class="divider">/</span></li>
                 </ul>
-                <input id="hueBreadcrumbText" type="text" class="input-xlarge" style="margin-top:4px;margin-right:4px;display:none" data-bind="value: currentPath" />
+                <input id="hueBreadcrumbText" type="text" class="input-xxlarge" style="margin-top:4px;margin-right:4px;display:none" data-bind="value: currentPath" />
             </li>
         </ul>
     % else:

+ 4 - 0
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -576,6 +576,10 @@ from django.utils.translation import ugettext as _
             self.retrieveData = function () {
                 self.isLoading(true);
                 $.getJSON(self.targetPath() + "?pagesize=" + self.recordsPerPage() + "&pagenum=" + self.targetPageNum() + "&filter=" + self.searchQuery() + "&sortby=" + self.sortBy() + "&descending=" + self.sortDescending() + "&format=json", function (data) {
+                    if (data.type != null && data.type == "file"){
+                        location.href = data.url;
+                        return false;
+                    }
                     self.updateFileList(data.files, data.page, data.breadcrumbs, data.current_dir_path);
                     if ($("#hueBreadcrumbText").is(":visible")){
                         $(".hueBreadcrumb").show();