ソースを参照

Fix #116: Hide remove and upload buttons until unless file(s) are selected

Kartik Visweswaran 10 年 前
コミット
6419937f3f
5 ファイル変更8 行追加4 行削除
  1. 1 0
      CHANGE.md
  2. 3 1
      css/fileinput.css
  3. 0 0
      css/fileinput.min.css
  4. 4 3
      js/fileinput.js
  5. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -11,6 +11,7 @@ version 4.1.5
 7. (bug #113): Icon layout template undefined when using user template.
 8. (bug #114): Prevent multiple file selection when using single file configuration.
 9. (enh #115): Autosize file caption responsively on window resize.
+10. (enh #116): Hide remove and upload buttons until unless file(s) are selected.
 
 version 4.1.4
 =============

+ 3 - 1
css/fileinput.css

@@ -124,7 +124,9 @@
     padding-top: 30px;
     text-align:right
 }
-.file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button {
+.file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, 
+.file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button,
+.file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button  {
     display: none;
 }
 

ファイルの差分が大きいため隠しています
+ 0 - 0
css/fileinput.min.css


+ 4 - 3
js/fileinput.js

@@ -490,6 +490,7 @@
                 $zone.prepend('<div class="' + self.dropZoneTitleClass + '">' + self.dropZoneTitle + '</div>');
             }
             self.$container.removeClass('file-input-new');
+            addCss(self.$container, 'file-input-ajax-new');
         },
         initFileActions: function() {
             var self = this;
@@ -1370,7 +1371,7 @@
                 self.showFileIcon();
             }
             self.setCaption(log);
-            self.$container.removeClass('file-input-new');
+            self.$container.removeClass('file-input-new file-input-ajax-new');
             if (arguments.length == 1) {
                 self.raise('fileselect', [numFiles, label]);
             }
@@ -1425,7 +1426,7 @@
                 self.isError = throwError(msg, null, null, null);
                 self.$captionContainer.find('.kv-caption-icon').hide();
                 self.$caption.html(self.msgValidationError);
-                self.$container.removeClass('file-input-new');
+                self.$container.removeClass('file-input-new file-input-ajax-new');
                 return;
             }
             if (!self.isIE9) {
@@ -1537,7 +1538,7 @@
             return '<button type="button" title="' + self.cancelTitle + '" class="hide ' + css + '">' + self.cancelIcon + self.cancelLabel + '</button>';
         },
         renderUpload: function () {
-            var self = this, css = self.uploadClass + ' kv-fileinput-upload', content = '', status = '';
+            var self = this, css = self.uploadClass + ' kv-fileinput-upload fileinput-upload-button', content = '', status = '';
             if (!self.showUpload) {
                 return '';
             }

ファイルの差分が大きいため隠しています
+ 0 - 0
js/fileinput.min.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません