|  | @@ -535,17 +535,14 @@
 | 
											
												
													
														|  |              return fileName ? '<b>' + fileName + ': </b>' + jqXHR : errMsg;
 |  |              return fileName ? '<b>' + fileName + ': </b>' + jqXHR : errMsg;
 | 
											
												
													
														|  |          },
 |  |          },
 | 
											
												
													
														|  |          raise: function (event, params) {
 |  |          raise: function (event, params) {
 | 
											
												
													
														|  | -            var self = this, e = $.Event(event), out = false;
 |  | 
 | 
											
												
													
														|  | 
 |  | +            var self = this, e = $.Event(event);
 | 
											
												
													
														|  |              if (params !== undefined) {
 |  |              if (params !== undefined) {
 | 
											
												
													
														|  |                  self.$element.trigger(e, params);
 |  |                  self.$element.trigger(e, params);
 | 
											
												
													
														|  |              } else {
 |  |              } else {
 | 
											
												
													
														|  |                  self.$element.trigger(e);
 |  |                  self.$element.trigger(e);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | -            if (e.result) {
 |  | 
 | 
											
												
													
														|  | -                out = true;
 |  | 
 | 
											
												
													
														|  | -            }
 |  | 
 | 
											
												
													
														|  | -            if (!out) {
 |  | 
 | 
											
												
													
														|  | -                return;
 |  | 
 | 
											
												
													
														|  | 
 |  | +            if (!e.result) {
 | 
											
												
													
														|  | 
 |  | +                return e.result;
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              switch (event) {
 |  |              switch (event) {
 | 
											
												
													
														|  |                  // ignore these events
 |  |                  // ignore these events
 | 
											
										
											
												
													
														|  | @@ -561,12 +558,14 @@
 | 
											
												
													
														|  |                  case 'filebatchuploaderror':
 |  |                  case 'filebatchuploaderror':
 | 
											
												
													
														|  |                  case 'filedeleteerror':
 |  |                  case 'filedeleteerror':
 | 
											
												
													
														|  |                  case 'filecustomerror':
 |  |                  case 'filecustomerror':
 | 
											
												
													
														|  | 
 |  | +                case 'filesuccessremove':
 | 
											
												
													
														|  |                      break;
 |  |                      break;
 | 
											
												
													
														|  |                  // can trigger filecustomerror to abort upload
 |  |                  // can trigger filecustomerror to abort upload
 | 
											
												
													
														|  |                  default:
 |  |                  default:
 | 
											
												
													
														|  | -                    self.ajaxAborted = out;
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    self.ajaxAborted = true;
 | 
											
												
													
														|  |                      break;
 |  |                      break;
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +            return true;
 | 
											
												
													
														|  |          },
 |  |          },
 | 
											
												
													
														|  |          getLayoutTemplate: function (t) {
 |  |          getLayoutTemplate: function (t) {
 | 
											
												
													
														|  |              var self = this,
 |  |              var self = this,
 | 
											
										
											
												
													
														|  | @@ -912,10 +911,25 @@
 | 
											
												
													
														|  |                  .repl('{upload}', btnUpload)
 |  |                  .repl('{upload}', btnUpload)
 | 
											
												
													
														|  |                  .repl('{other}', otherButtons);
 |  |                  .repl('{other}', otherButtons);
 | 
											
												
													
														|  |          },
 |  |          },
 | 
											
												
													
														|  | 
 |  | +        setThumbStatus: function ($thumb, status) {
 | 
											
												
													
														|  | 
 |  | +            var self = this, icon = 'indicator' + status, msg = icon + 'Title',
 | 
											
												
													
														|  | 
 |  | +                css = 'file-preview-' + status.toLowerCase(),
 | 
											
												
													
														|  | 
 |  | +                $indicator = $thumb.find('.file-upload-indicator'),
 | 
											
												
													
														|  | 
 |  | +                config = self.fileActionSettings;
 | 
											
												
													
														|  | 
 |  | +            $thumb.removeClass('file-preview-success file-preview-error file-preview-loading');
 | 
											
												
													
														|  | 
 |  | +            $indicator.html(config[icon]);
 | 
											
												
													
														|  | 
 |  | +            $indicator.attr('title', config[msg]);
 | 
											
												
													
														|  | 
 |  | +            $thumb.addClass(css);
 | 
											
												
													
														|  | 
 |  | +        },
 | 
											
												
													
														|  | 
 |  | +        clearPreview: function () {
 | 
											
												
													
														|  | 
 |  | +            var self = this, $thumbs = !self.showUploadedThumbs ? self.$preview.find('.file-preview-frame') :
 | 
											
												
													
														|  | 
 |  | +                self.$preview.find('.file-preview-frame:not(.file-preview-success)');
 | 
											
												
													
														|  | 
 |  | +            $thumbs.remove();
 | 
											
												
													
														|  | 
 |  | +        },
 | 
											
												
													
														|  |          initPreview: function (isInit) {
 |  |          initPreview: function (isInit) {
 | 
											
												
													
														|  |              var self = this, cap = self.initialCaption || '', out;
 |  |              var self = this, cap = self.initialCaption || '', out;
 | 
											
												
													
														|  |              if (!previewCache.count(self.id)) {
 |  |              if (!previewCache.count(self.id)) {
 | 
											
												
													
														|  | -                self.$preview.html('');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                self.clearPreview();
 | 
											
												
													
														|  |                  if (isInit) {
 |  |                  if (isInit) {
 | 
											
												
													
														|  |                      self.setCaption(cap);
 |  |                      self.setCaption(cap);
 | 
											
												
													
														|  |                  } else {
 |  |                  } else {
 | 
											
										
											
												
													
														|  | @@ -1245,14 +1259,30 @@
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          },
 |  |          },
 | 
											
												
													
														|  | 
 |  | +        initSuccessThumbs: function () {
 | 
											
												
													
														|  | 
 |  | +            var self = this;
 | 
											
												
													
														|  | 
 |  | +            self.getThumbs('.file-preview-success').each(function(){
 | 
											
												
													
														|  | 
 |  | +                var $thumb = $(this), $remove = $thumb.find('.kv-file-remove');
 | 
											
												
													
														|  | 
 |  | +                $remove.removeAttr('disabled').off('click').on('click', function () {
 | 
											
												
													
														|  | 
 |  | +                    var out = self.raise('filesuccessremove', [$thumb.attr('id'), $thumb.data('fileindex')]);
 | 
											
												
													
														|  | 
 |  | +                    if (out === false) {
 | 
											
												
													
														|  | 
 |  | +                        return;
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  | 
 |  | +                    $thumb.fadeOut('slow', function () {
 | 
											
												
													
														|  | 
 |  | +                        $thumb.remove();
 | 
											
												
													
														|  | 
 |  | +                        if (!self.$preview.find('.file-preview-frame').length) {
 | 
											
												
													
														|  | 
 |  | +                            self.reset();
 | 
											
												
													
														|  | 
 |  | +                        }
 | 
											
												
													
														|  | 
 |  | +                    });
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  | 
 |  | +            });
 | 
											
												
													
														|  | 
 |  | +        },
 | 
											
												
													
														|  |          uploadSingle: function (i, files, allFiles) {
 |  |          uploadSingle: function (i, files, allFiles) {
 | 
											
												
													
														|  |              var self = this, total = self.getFileStack().length, formdata = new FormData(), outData,
 |  |              var self = this, total = self.getFileStack().length, formdata = new FormData(), outData,
 | 
											
												
													
														|  |                  previewId = self.previewInitId + "-" + i, $thumb = $('#' + previewId + ':not(.file-preview-initial)'),
 |  |                  previewId = self.previewInitId + "-" + i, $thumb = $('#' + previewId + ':not(.file-preview-initial)'),
 | 
											
												
													
														|  |                  pct, chkComplete, $btnUpload = $thumb.find('.kv-file-upload'), $btnDelete = $thumb.find('.kv-file-remove'),
 |  |                  pct, chkComplete, $btnUpload = $thumb.find('.kv-file-upload'), $btnDelete = $thumb.find('.kv-file-remove'),
 | 
											
												
													
														|  | -                $indicator = $thumb.find('.file-upload-indicator'), config = self.fileActionSettings,
 |  | 
 | 
											
												
													
														|  | -                hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
 |  | 
 | 
											
												
													
														|  | -                setIndicator, updateProgress, resetActions, fnBefore, fnSuccess, fnComplete, fnError,
 |  | 
 | 
											
												
													
														|  | -                params = {id: previewId, index: i};
 |  | 
 | 
											
												
													
														|  | 
 |  | +                updateProgress, hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
 | 
											
												
													
														|  | 
 |  | +                resetActions, fnBefore, fnSuccess, fnComplete, fnError, params = {id: previewId, index: i};
 | 
											
												
													
														|  |              self.formdata = formdata;
 |  |              self.formdata = formdata;
 | 
											
												
													
														|  |              if (total === 0 || !hasPostData || $btnUpload.hasClass('disabled') || self.abort(params)) {
 |  |              if (total === 0 || !hasPostData || $btnUpload.hasClass('disabled') || self.abort(params)) {
 | 
											
												
													
														|  |                  return;
 |  |                  return;
 | 
											
										
											
												
													
														|  | @@ -1276,10 +1306,6 @@
 | 
											
												
													
														|  |                      self.raise('filebatchuploadcomplete', [self.filestack, self.getExtraData()]);
 |  |                      self.raise('filebatchuploadcomplete', [self.filestack, self.getExtraData()]);
 | 
											
												
													
														|  |                  }, 100);
 |  |                  }, 100);
 | 
											
												
													
														|  |              };
 |  |              };
 | 
											
												
													
														|  | -            setIndicator = function (icon, msg) {
 |  | 
 | 
											
												
													
														|  | -                $indicator.html(config[icon]);
 |  | 
 | 
											
												
													
														|  | -                $indicator.attr('title', config[msg]);
 |  | 
 | 
											
												
													
														|  | -            };
 |  | 
 | 
											
												
													
														|  |              updateProgress = function () {
 |  |              updateProgress = function () {
 | 
											
												
													
														|  |                  if (!allFiles || total === 0 || self.uploadPercent >= 100) {
 |  |                  if (!allFiles || total === 0 || self.uploadPercent >= 100) {
 | 
											
												
													
														|  |                      return;
 |  |                      return;
 | 
											
										
											
												
													
														|  | @@ -1297,8 +1323,10 @@
 | 
											
												
													
														|  |              };
 |  |              };
 | 
											
												
													
														|  |              fnBefore = function (jqXHR) {
 |  |              fnBefore = function (jqXHR) {
 | 
											
												
													
														|  |                  outData = self.getOutData(jqXHR);
 |  |                  outData = self.getOutData(jqXHR);
 | 
											
												
													
														|  | -                setIndicator('indicatorLoading', 'indicatorLoadingTitle');
 |  | 
 | 
											
												
													
														|  | -                addCss($thumb, 'file-uploading');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (!$thumb.hasClass('file-preview-success')) {
 | 
											
												
													
														|  | 
 |  | +                    self.setThumbStatus($thumb, 'Loading');
 | 
											
												
													
														|  | 
 |  | +                    addCss($thumb, 'file-uploading');
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  |                  $btnUpload.attr('disabled', true);
 |  |                  $btnUpload.attr('disabled', true);
 | 
											
												
													
														|  |                  $btnDelete.attr('disabled', true);
 |  |                  $btnDelete.attr('disabled', true);
 | 
											
												
													
														|  |                  if (!allFiles) {
 |  |                  if (!allFiles) {
 | 
											
										
											
												
													
														|  | @@ -1316,9 +1344,8 @@
 | 
											
												
													
														|  |                  params = $.extend(params, outData);
 |  |                  params = $.extend(params, outData);
 | 
											
												
													
														|  |                  setTimeout(function () {
 |  |                  setTimeout(function () {
 | 
											
												
													
														|  |                      if (data.error === undefined) {
 |  |                      if (data.error === undefined) {
 | 
											
												
													
														|  | -                        setIndicator('indicatorSuccess', 'indicatorSuccessTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        self.setThumbStatus($thumb, 'Success');
 | 
											
												
													
														|  |                          $btnUpload.hide();
 |  |                          $btnUpload.hide();
 | 
											
												
													
														|  | -                        $btnDelete.hide();
 |  | 
 | 
											
												
													
														|  |                          self.filestack[i] = undefined;
 |  |                          self.filestack[i] = undefined;
 | 
											
												
													
														|  |                          self.raise('fileuploaded', [outData, previewId, i]);
 |  |                          self.raise('fileuploaded', [outData, previewId, i]);
 | 
											
												
													
														|  |                          self.initUploadSuccess(data, $thumb, allFiles);
 |  |                          self.initUploadSuccess(data, $thumb, allFiles);
 | 
											
										
											
												
													
														|  | @@ -1326,7 +1353,7 @@
 | 
											
												
													
														|  |                              self.resetFileStack();
 |  |                              self.resetFileStack();
 | 
											
												
													
														|  |                          }
 |  |                          }
 | 
											
												
													
														|  |                      } else {
 |  |                      } else {
 | 
											
												
													
														|  | -                        setIndicator('indicatorError', 'indicatorErrorTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        self.setThumbStatus($thumb, 'Error');
 | 
											
												
													
														|  |                          self.showUploadError(data.error, params);
 |  |                          self.showUploadError(data.error, params);
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |                  }, 100);
 |  |                  }, 100);
 | 
											
										
											
												
													
														|  | @@ -1340,11 +1367,12 @@
 | 
											
												
													
														|  |                      } else {
 |  |                      } else {
 | 
											
												
													
														|  |                          chkComplete();
 |  |                          chkComplete();
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  | 
 |  | +                    self.initSuccessThumbs();
 | 
											
												
													
														|  |                  }, 100);
 |  |                  }, 100);
 | 
											
												
													
														|  |              };
 |  |              };
 | 
											
												
													
														|  |              fnError = function (jqXHR, textStatus, errorThrown) {
 |  |              fnError = function (jqXHR, textStatus, errorThrown) {
 | 
											
												
													
														|  |                  var errMsg = self.parseError(jqXHR, errorThrown, (allFiles ? files[i].name : null));
 |  |                  var errMsg = self.parseError(jqXHR, errorThrown, (allFiles ? files[i].name : null));
 | 
											
												
													
														|  | -                setIndicator('indicatorError', 'indicatorErrorTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                self.setThumbStatus($thumb, 'Error');
 | 
											
												
													
														|  |                  params = $.extend(params, self.getOutData(jqXHR));
 |  |                  params = $.extend(params, self.getOutData(jqXHR));
 | 
											
												
													
														|  |                  self.showUploadError(errMsg, params);
 |  |                  self.showUploadError(errMsg, params);
 | 
											
												
													
														|  |              };
 |  |              };
 | 
											
										
											
												
													
														|  | @@ -1355,26 +1383,12 @@
 | 
											
												
													
														|  |          uploadBatch: function () {
 |  |          uploadBatch: function () {
 | 
											
												
													
														|  |              var self = this, files = self.filestack, total = files.length, config,
 |  |              var self = this, files = self.filestack, total = files.length, config,
 | 
											
												
													
														|  |                  hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
 |  |                  hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),
 | 
											
												
													
														|  | -                setIndicator, setAllUploaded, enableActions, fnBefore, fnSuccess, fnComplete, fnError,
 |  | 
 | 
											
												
													
														|  | 
 |  | +                setAllUploaded, enableActions, fnBefore, fnSuccess, fnComplete, fnError,
 | 
											
												
													
														|  |                  params = {};
 |  |                  params = {};
 | 
											
												
													
														|  |              self.formdata = new FormData();
 |  |              self.formdata = new FormData();
 | 
											
												
													
														|  |              if (total === 0 || !hasPostData || self.abort(params)) {
 |  |              if (total === 0 || !hasPostData || self.abort(params)) {
 | 
											
												
													
														|  |                  return;
 |  |                  return;
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | -            config = self.fileActionSettings;
 |  | 
 | 
											
												
													
														|  | -            setIndicator = function (i, icon, msg) {
 |  | 
 | 
											
												
													
														|  | -                var $indicator = $('#' + self.previewInitId + "-" + i).find('.file-upload-indicator');
 |  | 
 | 
											
												
													
														|  | -                $indicator.html(config[icon]);
 |  | 
 | 
											
												
													
														|  | -                $indicator.attr('title', config[msg]);
 |  | 
 | 
											
												
													
														|  | -            };
 |  | 
 | 
											
												
													
														|  | -            enableActions = function (i) {
 |  | 
 | 
											
												
													
														|  | -                var $thumb = $('#' + self.previewInitId + "-" + i + ':not(.file-preview-initial)'),
 |  | 
 | 
											
												
													
														|  | -                    $btnUpload = $thumb.find('.kv-file-upload'),
 |  | 
 | 
											
												
													
														|  | -                    $btnDelete = $thumb.find('.kv-file-delete');
 |  | 
 | 
											
												
													
														|  | -                $thumb.removeClass('file-uploading');
 |  | 
 | 
											
												
													
														|  | -                $btnUpload.removeAttr('disabled');
 |  | 
 | 
											
												
													
														|  | -                $btnDelete.removeAttr('disabled');
 |  | 
 | 
											
												
													
														|  | -            };
 |  | 
 | 
											
												
													
														|  |              setAllUploaded = function () {
 |  |              setAllUploaded = function () {
 | 
											
												
													
														|  |                  $.each(files, function (key) {
 |  |                  $.each(files, function (key) {
 | 
											
												
													
														|  |                      self.filestack[key] = undefined;
 |  |                      self.filestack[key] = undefined;
 | 
											
										
											
												
													
														|  | @@ -1386,8 +1400,12 @@
 | 
											
												
													
														|  |                  var outData = self.getOutData(jqXHR);
 |  |                  var outData = self.getOutData(jqXHR);
 | 
											
												
													
														|  |                  if (self.showPreview) {
 |  |                  if (self.showPreview) {
 | 
											
												
													
														|  |                      self.getThumbs().each(function () {
 |  |                      self.getThumbs().each(function () {
 | 
											
												
													
														|  | -                        var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'), $btnDelete = $thumb.find('.kv-file-remove');
 |  | 
 | 
											
												
													
														|  | -                        addCss($thumb, 'file-uploading');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'),
 | 
											
												
													
														|  | 
 |  | +                            $btnDelete = $thumb.find('.kv-file-remove');
 | 
											
												
													
														|  | 
 |  | +                        if (!$thumb.hasClass('file-preview-success')) {
 | 
											
												
													
														|  | 
 |  | +                            self.setThumbStatus($thumb, 'Loading');
 | 
											
												
													
														|  | 
 |  | +                            addCss($thumb, 'file-uploading');
 | 
											
												
													
														|  | 
 |  | +                        }
 | 
											
												
													
														|  |                          $btnUpload.attr('disabled', true);
 |  |                          $btnUpload.attr('disabled', true);
 | 
											
												
													
														|  |                          $btnDelete.attr('disabled', true);
 |  |                          $btnDelete.attr('disabled', true);
 | 
											
												
													
														|  |                      });
 |  |                      });
 | 
											
										
											
												
													
														|  | @@ -1404,12 +1422,12 @@
 | 
											
												
													
														|  |                      self.raise('filebatchuploadsuccess', [outData]);
 |  |                      self.raise('filebatchuploadsuccess', [outData]);
 | 
											
												
													
														|  |                      setAllUploaded();
 |  |                      setAllUploaded();
 | 
											
												
													
														|  |                      if (self.showPreview) {
 |  |                      if (self.showPreview) {
 | 
											
												
													
														|  | -                        $thumbs.find('.kv-file-upload').hide();
 |  | 
 | 
											
												
													
														|  | -                        $thumbs.find('.kv-file-remove').hide();
 |  | 
 | 
											
												
													
														|  |                          $thumbs.each(function () {
 |  |                          $thumbs.each(function () {
 | 
											
												
													
														|  | -                            var $thumb = $(this), key = $thumb.attr('data-fileindex');
 |  | 
 | 
											
												
													
														|  | -                            setIndicator(key, 'indicatorSuccess', 'indicatorSuccessTitle');
 |  | 
 | 
											
												
													
														|  | -                            enableActions(key);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                            var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload');
 | 
											
												
													
														|  | 
 |  | +                            $thumb.find('.kv-file-upload').hide();
 | 
											
												
													
														|  | 
 |  | +                            self.setThumbStatus($thumb, 'Success');
 | 
											
												
													
														|  | 
 |  | +                            $thumb.removeClass('file-uploading');
 | 
											
												
													
														|  | 
 |  | +                            $btnUpload.removeAttr('disabled');
 | 
											
												
													
														|  |                          });
 |  |                          });
 | 
											
												
													
														|  |                          self.initUploadSuccess(data);
 |  |                          self.initUploadSuccess(data);
 | 
											
												
													
														|  |                      } else {
 |  |                      } else {
 | 
											
										
											
												
													
														|  | @@ -1418,18 +1436,20 @@
 | 
											
												
													
														|  |                  } else {
 |  |                  } else {
 | 
											
												
													
														|  |                      if (self.showPreview) {
 |  |                      if (self.showPreview) {
 | 
											
												
													
														|  |                          $thumbs.each(function () {
 |  |                          $thumbs.each(function () {
 | 
											
												
													
														|  | -                            var $thumb = $(this), key = parseInt($thumb.attr('data-fileindex'), 10);
 |  | 
 | 
											
												
													
														|  | -                            enableActions(key);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                            var $thumb = $(this), $btnDelete = $thumb.find('.kv-file-remove'),
 | 
											
												
													
														|  | 
 |  | +                                $btnUpload = $thumb.find('.kv-file-upload');
 | 
											
												
													
														|  | 
 |  | +                            $thumb.removeClass('file-uploading');
 | 
											
												
													
														|  | 
 |  | +                            $btnUpload.removeAttr('disabled');
 | 
											
												
													
														|  | 
 |  | +                            $btnDelete.removeAttr('disabled');
 | 
											
												
													
														|  |                              if (keys.length === 0) {
 |  |                              if (keys.length === 0) {
 | 
											
												
													
														|  | -                                setIndicator(key, 'indicatorError', 'indicatorErrorTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                self.setThumbStatus($thumb, 'Error');
 | 
											
												
													
														|  |                                  return;
 |  |                                  return;
 | 
											
												
													
														|  |                              }
 |  |                              }
 | 
											
												
													
														|  |                              if ($.inArray(key, keys) !== -1) {
 |  |                              if ($.inArray(key, keys) !== -1) {
 | 
											
												
													
														|  | -                                setIndicator(key, 'indicatorError', 'indicatorErrorTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                self.setThumbStatus($thumb, 'Error');
 | 
											
												
													
														|  |                              } else {
 |  |                              } else {
 | 
											
												
													
														|  |                                  $thumb.find('.kv-file-upload').hide();
 |  |                                  $thumb.find('.kv-file-upload').hide();
 | 
											
												
													
														|  | -                                $thumb.find('.kv-file-remove').hide();
 |  | 
 | 
											
												
													
														|  | -                                setIndicator(key, 'indicatorSuccess', 'indicatorSuccessTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                self.setThumbStatus($thumb, 'Success');
 | 
											
												
													
														|  |                                  self.filestack[key] = undefined;
 |  |                                  self.filestack[key] = undefined;
 | 
											
												
													
														|  |                              }
 |  |                              }
 | 
											
												
													
														|  |                          });
 |  |                          });
 | 
											
										
											
												
													
														|  | @@ -1441,6 +1461,7 @@
 | 
											
												
													
														|  |              fnComplete = function () {
 |  |              fnComplete = function () {
 | 
											
												
													
														|  |                  self.setProgress(100);
 |  |                  self.setProgress(100);
 | 
											
												
													
														|  |                  self.unlock();
 |  |                  self.unlock();
 | 
											
												
													
														|  | 
 |  | +                self.initSuccessThumbs();
 | 
											
												
													
														|  |                  self.raise('filebatchuploadcomplete', [self.filestack, self.getExtraData()]);
 |  |                  self.raise('filebatchuploadcomplete', [self.filestack, self.getExtraData()]);
 | 
											
												
													
														|  |                  self.clearFileInput();
 |  |                  self.clearFileInput();
 | 
											
												
													
														|  |              };
 |  |              };
 | 
											
										
											
												
													
														|  | @@ -1455,7 +1476,7 @@
 | 
											
												
													
														|  |                      var $thumb = $(this), key = $thumb.attr('data-fileindex');
 |  |                      var $thumb = $(this), key = $thumb.attr('data-fileindex');
 | 
											
												
													
														|  |                      $thumb.removeClass('file-uploading');
 |  |                      $thumb.removeClass('file-uploading');
 | 
											
												
													
														|  |                      if (self.filestack[key] !== undefined) {
 |  |                      if (self.filestack[key] !== undefined) {
 | 
											
												
													
														|  | -                        setIndicator(key, 'indicatorError', 'indicatorErrorTitle');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        self.setThumbStatus($thumb, 'Error');
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |                  });
 |  |                  });
 | 
											
												
													
														|  |                  self.getThumbs().removeClass('file-uploading');
 |  |                  self.getThumbs().removeClass('file-uploading');
 | 
											
										
											
												
													
														|  | @@ -1896,15 +1917,14 @@
 | 
											
												
													
														|  |                      self.setCaption(out.caption);
 |  |                      self.setCaption(out.caption);
 | 
											
												
													
														|  |                      self.initPreviewDeletes();
 |  |                      self.initPreviewDeletes();
 | 
											
												
													
														|  |                  } else {
 |  |                  } else {
 | 
											
												
													
														|  | -                    $preview.html('');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    self.clearPreview();
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |                  if (isSingleUpload && ctr > 0) {
 |  |                  if (isSingleUpload && ctr > 0) {
 | 
											
												
													
														|  |                      self.filestack = [];
 |  |                      self.filestack = [];
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              } else {
 |  |              } else {
 | 
											
												
													
														|  |                  if (isAjaxUpload && self.overwriteInitial) {
 |  |                  if (isAjaxUpload && self.overwriteInitial) {
 | 
											
												
													
														|  | -                    $preview.html('');
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    self.clearPreview();
 | 
											
												
													
														|  |                      self.filestack = [];
 |  |                      self.filestack = [];
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
										
											
												
													
														|  | @@ -2074,6 +2094,7 @@
 | 
											
												
													
														|  |          showRemove: true,
 |  |          showRemove: true,
 | 
											
												
													
														|  |          showUpload: true,
 |  |          showUpload: true,
 | 
											
												
													
														|  |          showCancel: true,
 |  |          showCancel: true,
 | 
											
												
													
														|  | 
 |  | +        showUploadedThumbs: true,
 | 
											
												
													
														|  |          mainClass: '',
 |  |          mainClass: '',
 | 
											
												
													
														|  |          previewClass: '',
 |  |          previewClass: '',
 | 
											
												
													
														|  |          captionClass: '',
 |  |          captionClass: '',
 |