소스 검색

Fix #1448: New boolean properties `focusCaptionOnBrowse` and `focusCaptionOnClear`

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

+ 2 - 1
CHANGE.md

@@ -8,7 +8,8 @@ Change Log: `bootstrap-fileinput`
 - (enh #1461): Allow two different max file count checks
     - `maxFileCount` and `msgFilesTooMany` for files being selected before upload
     - `maxTotalFileCount` and `msgTotalFilesTooMany` for total files selected and files included in initial preview
-
+- (enh #1448): New boolean properties `focusCaptionOnBrowse` and `focusCaptionOnClear` which default to `true`.
+  
 ## version 5.0.6
 
 **Date:** 11-Sep-2019

+ 8 - 2
js/fileinput.js

@@ -4577,7 +4577,9 @@
             if (self.isError && !self.isAjaxUpload) {
                 self.clear();
             }
-            self.$captionContainer.focus();
+            if (self.focusCaptionOnBrowse) {
+                self.$captionContainer.focus();
+            }
         },
         _change: function (e) {
             var self = this;
@@ -5173,7 +5175,9 @@
                 }
             }
             self._hideFileIcon();
-            self.$captionContainer.focus();
+            if (self.focusCaptionOnClear) {
+                self.$captionContainer.focus();
+            }
             self._setFileDropZoneTitle();
             self._raise('filecleared');
             return self.$element;
@@ -5389,6 +5393,8 @@
         rtl: false,
         hideThumbnailContent: false,
         encodeUrl: true,
+        focusCaptionOnBrowse: true,
+        focusCaptionOnClear: true,
         generateFileId: null,
         previewClass: '',
         captionClass: '',

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


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