瀏覽代碼

Fix #1631: Correct modal dialog `aria-labelledby` binding

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

+ 1 - 0
CHANGE.md

@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
 
 **Date**: _under development_
 
+- (bug #1631): Correct modal dialog `aria-labelledby` binding.
 - (enh #1630): New `preProcessUpload` callback that can convert / encrypt file content before upload.
 - (enh #1627): Add bootstrap 4 progress bar animation.
 - (enh #1625): Default `minFileSize` to -1 to allow zero byte files to be uploaded.

+ 5 - 4
js/fileinput.js

@@ -1618,7 +1618,7 @@
                 tModalMain, tModal, tProgress, tSize, tFooter, tActions, tActionDelete, tActionUpload, tActionDownload,
                 tActionZoom, tActionDrag, tIndicator, tTagBef, tTagBef1, tTagBef2, tTagAft, tGeneric, tHtml, tImage,
                 tText, tOffice, tGdocs, tVideo, tAudio, tFlash, tObject, tPdf, tOther, tStyle, tZoomCache, vDefaultDim,
-                tStats;
+                tStats, tModalLabel;
             tMain1 = '{preview}\n' +
                 '<div class="kv-upload-progress kv-hidden"></div><div class="clearfix"></div>\n' +
                 '<div class="input-group {class}">\n' +
@@ -1656,12 +1656,13 @@
             tBtnLink = '<a href="{href}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</a>';
             //noinspection HtmlUnknownAttribute
             tBtnBrowse = '<div tabindex="500" class="{css}" {status}>{icon} {label}</div>';
+            tModalLabel =  $h.MODAL_ID + 'Label';
             tModalMain = '<div id="' + $h.MODAL_ID + '" class="file-zoom-dialog modal fade" ' +
-                'tabindex="-1" aria-labelledby="' + $h.MODAL_ID + 'Label"></div>';
+                'tabindex="-1" aria-labelledby="' + tModalLabel + '"></div>';
             tModal = '<div class="modal-dialog modal-lg{rtl}" role="document">\n' +
                 '  <div class="modal-content">\n' +
                 '    <div class="modal-header">\n' +
-                '      <h5 class="modal-title">{heading}</h5>\n' +
+                '      <h5 class="modal-title" id="' + tModalLabel + '">{heading}</h5>\n' +
                 '      <span class="kv-zoom-title"></span>\n' +
                 '      <div class="kv-zoom-actions">{toggleheader}{fullscreen}{borderless}{close}</div>\n' +
                 '    </div>\n' +
@@ -3616,7 +3617,7 @@
             self._setUploadData(formdata, {fileId: id});
             self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError, formdata, id, i);
         },
-        _setFileData: function(formdata, file, fileName, fileId) {
+        _setFileData: function (formdata, file, fileName, fileId) {
             var self = this, preProcess = self.preProcessUpload;
             if (preProcess && typeof preProcess === 'function') {
                 formdata.append(self.uploadFileAttr, preProcess(fileId, file));

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


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