소스 검색

Fix #1540: Better validation of `required` property

Kartik Visweswaran 5 년 전
부모
커밋
8530f7f2e9
3개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      CHANGE.md
  2. 4 1
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -9,6 +9,7 @@ Change Log: `bootstrap-fileinput`
 - (bug #1551): Correct MIME Type detection for PNG.
 - (enh #1548): Correct `filebatchselected` trigger for single file uploads.
 - (enh #1545, #1546): Enhance file path for folder drag.
+- (enh #1540): Better validation of `required` property.
 - (bug #1518, #1522): Initial preview rendering correction when preview returned by server immediately after upload.
 
 ## version 5.0.8

+ 4 - 1
js/fileinput.js

@@ -4740,6 +4740,9 @@
         },
         _isFileSelectionValid: function (cnt) {
             var self = this;
+            if (self.isDisabled) {
+                return true;
+            }
             cnt = cnt || 0;
             if (self.required && !self.getFilesCount()) {
                 self.$errorContainer.html('');
@@ -5305,7 +5308,7 @@
         upload: function () {
             var self = this, fm = self.fileManager, totLen = fm.count(), i, outData,
                 hasExtraData = !$.isEmptyObject(self._getExtraData());
-            if (!self.isAjaxUpload || self.isDisabled || !self._isFileSelectionValid(totLen)) {
+            if (!self.isAjaxUpload || !self._isFileSelectionValid(totLen)) {
                 return;
             }
             self.lastProgress = 0;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
js/fileinput.min.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.