소스 검색

Fix #1512: Include parameter to include initial preview files in `getFilesCount` method

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

+ 1 - 0
CHANGE.md

@@ -9,6 +9,7 @@ Change Log: `bootstrap-fileinput`
     - New event `fileduplicateerror` will be triggered after every duplicate file detected.
     - Duplicate error container can be closed by clicking the `close` icon.
     - New property `fadeDelay` used in fade out / fade in animations of error containers.    
+- (enh #1512): Include parameter to include initial preview files in `getFilesCount` method.
 - (bug #1510): Lock browse button correctly when disable method is called.
 - (bug #1508): Correct file caption after files are uploaded.
 - (bug #1499, #1502): Correct duplicate file check error rendering.

+ 5 - 2
js/fileinput.js

@@ -4770,8 +4770,11 @@
         getFileList: function () {
             return this.fileManager.list();
         },
-        getFilesCount: function () {
+        getFilesCount: function (includeInitial) {
             var self = this, len = self.isAjaxUpload ? self.fileManager.count() : self._inputFileCount();
+            if (includeInitial) {
+                len += self.previewCache.count(true);
+            }
             return self._getFileCount(len);
         },
         readFiles: function (files) {
@@ -4829,7 +4832,7 @@
                             $error.find('ul').append(errors);
                         }
                         $error.fadeIn(self.fadeDelay);
-                        self._handler($error.find('.kv-error-close'), 'click', function() {
+                        self._handler($error.find('.kv-error-close'), 'click', function () {
                             $error.fadeOut(self.fadeDelay);
                         });
                         self.duplicateErrors = [];

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


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