瀏覽代碼

Fix #942: Correct indicator markup within thumbnail footer

Kartik Visweswaran 8 年之前
父節點
當前提交
7d2acbfbee
共有 4 個文件被更改,包括 9 次插入10 次删除
  1. 1 1
      CHANGE.md
  2. 6 6
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js
  4. 2 3
      themes/explorer/theme.js

+ 1 - 1
CHANGE.md

@@ -8,7 +8,7 @@ Change Log: `bootstrap-fileinput`
 - Chronological ordering of issues for change log.
 - (enh #947): Correct `showDelete` validation in `fileActionSettings`.
 - (enh #946): Enhance iconic preview validation to ignore extension case if possible.
-- (enh #942): Enhance indicator and drag templates. New layout template `actionIndicator`.
+- (enh #942): Enhance indicator and drag templates. New layout template `indicator`.
 - (enh #941): Correct `data-fileindex` validation.
 - (bug #940): Correct validation of `initialPreviewShowDelete`.
 - (enh #936): Enhance custom validation when ajax abort is triggered via event manipulation.

+ 6 - 6
js/fileinput.js

@@ -349,7 +349,7 @@
         _initTemplateDefaults: function () {
             var self = this, tMain1, tMain2, tPreview, tFileIcon, tClose, tCaption, tBtnDefault, tBtnLink, tBtnBrowse,
                 tModalMain, tModal, tProgress, tSize, tFooter, tActions, tActionDelete, tActionUpload, tActionZoom,
-                tActionDrag, tActionInd, tTagBef, tTagBef1, tTagBef2, tTagAft, tGeneric, tHtml, tImage, tText, tVideo,
+                tActionDrag, tIndicator, tTagBef, tTagBef1, tTagBef2, tTagAft, tGeneric, tHtml, tImage, tText, tVideo,
                 tAudio, tFlash, tObject, tPdf, tOther, tZoomCache, vDefaultDim;
             tMain1 = '{preview}\n' +
                 '<div class="kv-upload-progress hide"></div>\n' +
@@ -408,9 +408,9 @@
             tSize = ' <samp>({sizeText})</samp>';
             tFooter = '<div class="file-thumbnail-footer">\n' +
                 '    <div class="file-footer-caption" title="{caption}">{caption}<br>{size}</div>\n' +
-                '    {progress} {actions}\n' +
+                '    {progress} {indicator} {actions}\n' +
                 '</div>';
-            tActions = '{indicator}\n' + '{drag}\n' +
+            tActions = '{drag}\n' +
                 '<div class="file-actions">\n' +
                 '    <div class="file-footer-buttons">\n' +
                 '        {upload} {delete} {zoom} {other}' +
@@ -425,7 +425,7 @@
             tActionZoom = '<button type="button" class="kv-file-zoom {zoomClass}" ' +
                 'title="{zoomTitle}">{zoomIcon}</button>';
             tActionDrag = '<span class="file-drag-handle {dragClass}" title="{dragTitle}">{dragIcon}</span>';
-            tActionInd = '<div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>';
+            tIndicator = '<div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>';
             tTagBef = '<div class="file-preview-frame {frameClass}" id="{previewId}" data-fileindex="{fileindex}"' +
                 ' data-template="{template}"';
             tTagBef1 = tTagBef + '><div class="kv-file-content">\n';
@@ -467,12 +467,12 @@
                     progress: tProgress,
                     size: tSize,
                     footer: tFooter,
+                    indicator: tIndicator,
                     actions: tActions,
                     actionDelete: tActionDelete,
                     actionUpload: tActionUpload,
                     actionZoom: tActionZoom,
                     actionDrag: tActionDrag,
-                    actionIndicator: tActionInd,
                     btnDefault: tBtnDefault,
                     btnLink: tBtnLink,
                     btnBrowse: tBtnBrowse,
@@ -2981,7 +2981,7 @@
             var self = this, config = self.fileActionSettings, rem = config.showRemove, drg = config.showDrag,
                 upl = config.showUpload, zoom = config.showZoom, out, template = self._getLayoutTemplate('footer'),
                 ind = isError ? config.indicatorError : config.indicatorNew,
-                tInd = self._getLayoutTemplate('actionIndicator'),
+                tInd = self._getLayoutTemplate('indicator'),
                 title = isError ? config.indicatorErrorTitle : config.indicatorNewTitle,
                 indicator = tInd.replace(/\{indicator}/g, ind).replace(/\{indicatorTitle}/g, title);
             size = self._getSize(size);

File diff suppressed because it is too large
+ 0 - 0
js/fileinput.min.js


+ 2 - 3
themes/explorer/theme.js

@@ -27,9 +27,8 @@
             '    </div>\n' +
             '</div>',
             footer: '<td class="file-details-cell"><div class="explorer-caption" title="{caption}">{caption}</div> ' +
-            '{size}{progress}</td><td class="file-actions-cell">{actions}</td>',
-            actions: '<div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>\n' +
-            '{drag}\n' +
+            '{size}{progress}</td><td class="file-actions-cell">{indicator} {actions}</td>',
+            actions: '{drag}\n' +
             '<div class="file-actions">\n' +
             '    <div class="file-footer-buttons">\n' +
             '        {upload} {delete} {zoom} {other} ' +

Some files were not shown because too many files changed in this diff