Prechádzať zdrojové kódy

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

Kartik Visweswaran 5 rokov pred
rodič
commit
e5dd8f9e73
3 zmenil súbory, kde vykonal 10 pridanie a 3 odobranie
  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: '',

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
js/fileinput.min.js


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov