Kaynağa Gözat

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

Kartik Visweswaran 5 yıl önce
ebeveyn
işleme
e5dd8f9e73
3 değiştirilmiş dosya ile 10 ekleme ve 3 silme
  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
 - (enh #1461): Allow two different max file count checks
     - `maxFileCount` and `msgFilesTooMany` for files being selected before upload
     - `maxFileCount` and `msgFilesTooMany` for files being selected before upload
     - `maxTotalFileCount` and `msgTotalFilesTooMany` for total files selected and files included in initial preview
     - `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
 ## version 5.0.6
 
 
 **Date:** 11-Sep-2019
 **Date:** 11-Sep-2019

+ 8 - 2
js/fileinput.js

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

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
js/fileinput.min.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor