Переглянути джерело

Fix #1149: Enhance download button behavior to allow Firefox browser to download

Kartik Visweswaran 7 роки тому
батько
коміт
9f04dee8bb
3 змінених файлів з 7 додано та 12 видалено
  1. 5 0
      CHANGE.md
  2. 2 12
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 5 - 0
CHANGE.md

@@ -5,6 +5,11 @@ Change Log: `bootstrap-fileinput`
 
 **Date:** _work in progress_
 
+- (enh #1149): Enhance download button behavior to allow Firefox browser to download.
+- (enh #1143): Correct translation path in docs.
+- (enh #1142, #1141): Update Georgian translations.
+- (enh #1138, #1137): Update Italian translations.
+- (enh #1134): Update Polish translations.
 - (enh #1131): New public method `readFiles` to allow input & preview of file objects programmatically.
 - (enh #1128, #1129): Update rubaxa sortable plugin to fix Chrome support errors.
 - (enh #1127): Update Italian Translations.

+ 2 - 12
js/fileinput.js

@@ -689,8 +689,8 @@
                 'title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n';
             tActionUpload = '<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">' +
                 '{uploadIcon}</button>';
-            tActionDownload = '<button type="button" class="kv-file-download {downloadClass}" title="{downloadTitle}" ' +
-                'data-url="{downloadUrl}" data-caption="{caption}">{downloadIcon}</button>';
+            tActionDownload = '<a class="kv-file-download {downloadClass}" title="{downloadTitle}" ' +
+                'href="{downloadUrl}" download="{caption}" target="_blank">{downloadIcon}</a>';
             tActionZoom = '<button type="button" class="kv-file-zoom {zoomClass}" ' +
                 'title="{zoomTitle}">{zoomIcon}</button>';
             tActionDrag = '<span class="file-drag-handle {dragClass}" title="{dragTitle}">{dragIcon}</span>';
@@ -2678,16 +2678,6 @@
                     }
                 });
             });
-            self.getFrames(' .kv-file-download').each(function () {
-                var $el = $(this);
-                self._handler($el, 'click', function () {
-                    var a = document.createElement('a');
-                    a.href = $el.attr('data-url');
-                    a.download = $el.attr('data-caption');
-                    a.target = '_blank';
-                    a.click();
-                });
-            });
         },
         _hideFileIcon: function () {
             var self = this;

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
js/fileinput.min.js


Деякі файли не було показано, через те що забагато файлів було змінено