فهرست منبع

Modified edit design filechooser form, removed filechooser bump to top of the page on click

Enrico Berti 13 سال پیش
والد
کامیت
8cb777a4fd
2فایلهای تغییر یافته به همراه6 افزوده شده و 17 حذف شده
  1. 4 15
      apps/jobsub/src/jobsub/templates/edit_design.mako
  2. 2 2
      desktop/core/static/js/Source/jHue/jquery.filechooser.js

+ 4 - 15
apps/jobsub/src/jobsub/templates/edit_design.mako

@@ -156,7 +156,8 @@ ${layout.menubar(section='designs')}
 
     ## Submit
     <div class="form-actions">
-      <button data-bind="click: submit" class="btn btn-large btn-primary">Save</button>
+      <button data-bind="click: submit" class="btn btn-primary">Save</button>
+      <a href="/jobsub" class="btn">Cancel</a>
     </div>
   </form>
 
@@ -188,11 +189,11 @@ ${layout.menubar(section='designs')}
 
     #fileChooserModal {
         padding:14px;
-        height:370px;
+        height:270px;
     }
 
     #fileChooserModal > ul {
-        height:330px;
+        height:230px;
         overflow-y:auto;
     }
 
@@ -307,18 +308,6 @@ ${layout.menubar(section='designs')}
             init: function(element, valueAccessor, allBindings, model) {
 				var self = $(element);
 				self.after(getFileBrowseButton(self));
-                $(element).click(function() {
-                    $("#fileChooserModal").jHueFileChooser({
-                        onFileChoose: function(filePath) {
-                            var binding = valueAccessor();
-                            binding["name"] = filePath;
-                            $("#chooseFile").modal("hide");
-                            $(element).val(filePath);
-                        },
-                        createFolder: false
-                    });
-                    $("#chooseFile").modal("show");
-                });
             }
         };
 

+ 2 - 2
desktop/core/static/js/Source/jHue/jquery.filechooser.js

@@ -32,7 +32,7 @@
 		$.getJSON("/filebrowser/chooser"+path, function(data){
 			var _flist = $("<ul>").addClass("unstyled");
             if (data.title != null && data.title == "Error"){
-                var _errorMsg = $("<div>").addClass("alert").addClass("alert-error").text(data.message + " -- " + _parent.previousPath);
+                var _errorMsg = $("<div>").addClass("alert").addClass("alert-error").text(data.message);
                 _errorMsg.appendTo($(_parent.element));
                 var _previousLink = $("<button>").addClass("btn").addClass("bnt-small").text("Back").click(function(){
                     _parent.options.onFolderChange(_parent.previousPath);
@@ -45,7 +45,7 @@
                 $(data.files).each(function(cnt, file){
                     var _f = $("<li>");
                     var _flink = $("<a>");
-                    _flink.attr("href","#").text(file.name).appendTo(_f);
+                    _flink.attr("href","javascript:void(0)").text(file.name).appendTo(_f);
                     if (file.type == "dir"){
                         _f.addClass("folder");
                         _f.click(function(){