Explorar el Código

Fix #387: Reset `initialCaption` better when preview is cleared

Kartik Visweswaran hace 9 años
padre
commit
cbc2ddd103
Se han modificado 3 ficheros con 8 adiciones y 6 borrados
  1. 5 4
      CHANGE.md
  2. 3 2
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 5 - 4
CHANGE.md

@@ -14,10 +14,11 @@ Change Log: `bootstrap-fileinput`
 7. Update translations to include `fileActionSettings`.
 7. Update translations to include `fileActionSettings`.
 8. (enh #382): Better implementation for parsing text in `parseError` method.
 8. (enh #382): Better implementation for parsing text in `parseError` method.
 9. (enh #385): Updated Russian & Ukranian translations.
 9. (enh #385): Updated Russian & Ukranian translations.
-10. (enh #389): New templates and styling enhancements to caption and main buttons.
-11. (enh #390): Thumbnail error display enhancements.
-12. (enh #391): Thumbnail styling enhancements for flash, html, and object types.
-13. (enh #393): Minor enhancements to abort events before upload.
+10. (enh #387): Reset `initialCaption` better when preview is cleared.
+11. (enh #389): New templates and styling enhancements to caption and main buttons.
+12. (enh #390): Thumbnail error display enhancements.
+13. (enh #391): Thumbnail styling enhancements for flash, html, and object types.
+14. (enh #393): Minor enhancements to abort events before upload.
 
 
 ## version 4.2.5
 ## version 4.2.5
 
 

+ 3 - 2
js/fileinput.js

@@ -1198,11 +1198,12 @@
             self.setFileDropZoneTitle();
             self.setFileDropZoneTitle();
         },
         },
         resetPreview: function () {
         resetPreview: function () {
-            var self = this, out;
+            var self = this, out, cap;
             if (previewCache.count(self.id)) {
             if (previewCache.count(self.id)) {
                 out = previewCache.out(self.id);
                 out = previewCache.out(self.id);
                 self.$preview.html(out.content);
                 self.$preview.html(out.content);
-                self.setCaption(out.caption);
+                cap = self.initialCaption ? self.initialCaption : out.caption;
+                self.setCaption(cap);
             } else {
             } else {
                 self.clearPreview();
                 self.clearPreview();
                 self.initCaption();
                 self.initCaption();

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
js/fileinput.min.js


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio