Kaynağa Gözat

Fix #1242: Correct drop zone enabling check for ajax uploads

Kartik Visweswaran 7 yıl önce
ebeveyn
işleme
e03b5351c7
3 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 1 0
      CHANGE.md
  2. 4 1
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
 
 **Date:** _work in process_
 
+- (bug #1242): Correct drop zone enabling check for ajax uploads.
 - (bug #1232): Correct RTL input group button styling.
 - (enh #1228): Enhance and correct preview refresh for various scenarios.
 - (bug #1226): Enhance native input display styling when `showBrowse` is `false`.

+ 4 - 1
js/fileinput.js

@@ -574,12 +574,15 @@
             self.progressTemplate = t.replace('{class}', self.progressClass);
             self.progressCompleteTemplate = t.replace('{class}', self.progressCompleteClass);
             self.progressErrorTemplate = t.replace('{class}', self.progressErrorClass);
-            self.dropZoneEnabled = $h.hasDragDropSupport() && self.dropZoneEnabled && $h.canAssignFilesToInput();
             self.isDisabled = $el.attr('disabled') || $el.attr('readonly');
             if (self.isDisabled) {
                 $el.attr('disabled', true);
             }
             self.isAjaxUpload = $h.hasFileUploadSupport() && !$h.isEmpty(self.uploadUrl);
+            self.dropZoneEnabled = $h.hasDragDropSupport() && self.dropZoneEnabled;
+            if (!self.isAjaxUpload) {
+                self.dropZoneEnabled = self.dropZoneEnabled && $h.canAssignFilesToInput();
+            }
             self.isClickable = self.browseOnZoneClick && self.showPreview &&
                 (self.dropZoneEnabled || !$h.isEmpty(self.defaultPreviewContent));
             self.slug = typeof options.slugCallback === "function" ? options.slugCallback : self._slugDefault;

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