|
346 | 346 | '</div>\n'; |
347 | 347 | //noinspection HtmlUnknownAttribute |
348 | 348 | tBtnDefault = '<button type="{type}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</button>'; |
| 349 | + //noinspection HtmlUnknownAttribute |
349 | 350 | tBtnLink = '<a href="{href}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</a>'; |
| 351 | + //noinspection HtmlUnknownAttribute |
350 | 352 | tBtnBrowse = '<div tabindex="500" class="{css}" {status}>{icon} {label}</div>'; |
351 | 353 | tModalMain = '<div id="' + MODAL_ID + '" class="file-zoom-dialog modal fade" tabindex="-1" aria-labelledby="' + |
352 | 354 | MODAL_ID + 'Label"></div>'; |
|
381 | 383 | ' <div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>\n' + |
382 | 384 | ' <div class="clearfix"></div>\n' + |
383 | 385 | '</div>'; |
384 | | - tActionDelete = '<button type="button" class="kv-file-remove {removeClass}" ' + |
385 | | - 'title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n'; |
| 386 | + //noinspection HtmlUnknownAttribute |
| 387 | + tActionDelete = '<button type="button" class="kv-file-remove {removeClass}" ' + 'title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n'; |
386 | 388 | tActionUpload = '<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">' + |
387 | 389 | '{uploadIcon}</button>'; |
388 | 390 | tActionZoom = '<button type="button" class="kv-file-zoom {zoomClass}" title="{zoomTitle}">{zoomIcon}</button>'; |
|
1049 | 1051 | return; |
1050 | 1052 | } |
1051 | 1053 | $el = $preview.find('.file-initial-thumbs'); |
| 1054 | + //noinspection JSUnusedGlobalSymbols |
1052 | 1055 | settings = { |
1053 | 1056 | handle: '.drag-handle-init', |
1054 | 1057 | dataIdAttr: 'data-preview-id', |
|
1556 | 1559 | form: self.formdata, |
1557 | 1560 | files: filesData, |
1558 | 1561 | filenames: self.filenames, |
| 1562 | + filescount: self.getFilesCount(), |
1559 | 1563 | extra: self._getExtraData(), |
1560 | 1564 | response: responseData, |
1561 | 1565 | reader: self.reader, |
|
1620 | 1624 | }, |
1621 | 1625 | _initUploadSuccess: function (out, $thumb, allFiles) { |
1622 | 1626 | var self = this, append, data, index, $newThumb, content, config, tags, i, |
1623 | | - mergeArray = function(prop, content) { |
| 1627 | + mergeArray = function (prop, content) { |
1624 | 1628 | if (!(self[prop] instanceof Array)) { |
1625 | 1629 | self[prop] = []; |
1626 | 1630 | } |
|
2342 | 2346 | }, |
2343 | 2347 | _setProgress: function (p, $el, error) { |
2344 | 2348 | var self = this, pct = Math.min(p, 100), template = pct < 100 ? self.progressTemplate : |
2345 | | - (error ? self.progressErrorTemplate : (p <= 100 ? self.progressTemplate : self.progressCompleteTemplate)), |
| 2349 | + (error ? self.progressErrorTemplate : (p <= 100 ? self.progressTemplate : self.progressCompleteTemplate)), |
2346 | 2350 | pctLimit = self.progressUploadThreshold; |
2347 | 2351 | $el = $el || self.$progress; |
2348 | 2352 | if (!isEmpty(template)) { |
|
2385 | 2389 | }, |
2386 | 2390 | _validateMinCount: function () { |
2387 | 2391 | var self = this, len = self.isUploadable ? self.getFileStack().length : self.$element.get(0).files.length; |
2388 | | - if (self.validateInitialCount && self.minFileCount > 0 && self._getFileCount( |
2389 | | - len - 1) < self.minFileCount) { |
| 2392 | + if (self.validateInitialCount && self.minFileCount > 0 && self._getFileCount(len - 1) < self.minFileCount) { |
2390 | 2393 | self._noFilesError({}); |
2391 | 2394 | return false; |
2392 | 2395 | } |
|
2871 | 2874 | return (skipNull ? n !== undefined : n !== undefined && n !== null); |
2872 | 2875 | }); |
2873 | 2876 | }, |
| 2877 | + getFilesCount: function () { |
| 2878 | + var self = this, len = self.isUploadable ? self.getFileStack().length : self.$element.get(0).files.length; |
| 2879 | + return self._getFileCount(len); |
| 2880 | + }, |
2874 | 2881 | lock: function () { |
2875 | 2882 | var self = this; |
2876 | 2883 | self._resetErrors(); |
|
0 commit comments