Sfoglia il codice sorgente

HUE-5457 [fb] The edit file 'save as' should display better the filechooser

Enrico Berti 9 anni fa
parent
commit
83a395e
1 ha cambiato i file con 25 aggiunte e 18 eliminazioni
  1. 25 18
      apps/filebrowser/src/filebrowser/templates/edit.mako

+ 25 - 18
apps/filebrowser/src/filebrowser/templates/edit.mako

@@ -68,18 +68,18 @@ ${ fb_components.menubar() }
 </div>
 
 
-<div id="saveAsModal" class="modal hide fade">
+<div id="saveAsModal" class="modal hide fade" style="width: 574px; margin-left: -287px">
     <form id="saveAsForm" action="${url('filebrowser.views.save_file')}" method="POST" class="form-stacked form-padding-fix">
     ${ csrf_token(request) | n,unicode }
     <div class="modal-header">
         <a href="#" class="close" data-dismiss="modal">&times;</a>
         <h3>${_('Save as')}</h3>
     </div>
-    <div class="modal-body">
+    <div class="modal-body" style="max-height: 430px">
         <span class="help-block">${_("Enter the location where you would like to save the file.")}</span>
-        ${ edit.render_field(form["path"], notitle=True, nolabel=True, klass="pathChooser input-xxlarge") }
+        ${ edit.render_field(form["path"], notitle=True, nolabel=True, klass="pathChooser input-xxlarge", attrs={ 'style': 'margin-bottom: 0' }) }
         <br/>
-        <div id="fileChooserSaveModal" class="hide"></div>
+        <div id="fileChooserSaveModal" class="hide margin-top-10"></div>
     </div>
     <div class="modal-footer">
         <div id="saveAsNameRequiredAlert" class="alert-message error hide" style="position: absolute; left: 10;">
@@ -142,21 +142,28 @@ ${ fb_components.menubar() }
         $("#saveAsNameRequiredAlert").hide();
       });
 
-      $(".pathChooser").click(function() {
-        var self = this;
-        $("#fileChooserSaveModal").jHueFileChooser({
-          initialPath:$(self).val(),
-          onFileChoose:function (filePath) {
-            $(self).val(filePath);
-          },
-          onFolderChange:function (folderPath) {
-            $(self).val(folderPath);
-          },
-          createFolder:false,
-          uploadFile:false
+      function getBrowseButton() {
+        var self = $('.pathChooser');
+        return $('<a>').addClass('btn').addClass('fileChooserBtn').text('..').click(function (e) {
+          e.preventDefault();
+          $('#fileChooserSaveModal').jHueFileChooser({
+            initialPath: $(self).val(),
+            onFileChoose: function (filePath) {
+              $(self).val(filePath);
+            },
+            onFolderChange: function (folderPath) {
+              $(self).val(folderPath);
+            },
+            createFolder: false,
+            uploadFile: false
+          });
+          $('#fileChooserSaveModal').slideDown();
         });
-        $("#fileChooserSaveModal").slideDown();
-      });
+
+      }
+
+      $('.pathChooser').after(getBrowseButton());
+
 
       function resizeTextarea() {
         var RESIZE_CORRECTION = 246;