Skip to content

Commit

Permalink
Fix Eonasdan#183: Delete extra data enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Mar 4, 2015
1 parent 59ed0c5 commit dd9a8de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ version 4.1.8
7. (enh #178): Updated README for cancel button configuration.
8. (enh #179): Validate and cast `maxFileSize`, `maxFileCount`, and `initialPreviewCount` to numeric - even if they have been setup as a string.
9. (enh #181): Fix change event triggered for IE 11 when file input is set to empty.
10. (enh #183): Delete extra data enhancements.

version 4.1.7
=============
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ initialPreviewConfig: [

> Note: The ajax delete action will send the following data to server via POST:
- `key`: the key setting as setup in `initialPreviewConfig['key']`
- `extra`: the extra data passed either via `initialPreviewConfig['extra']` OR `deleteExtraData` if former is not set.
- any other extra data as `key: value` pairs passed either via `initialPreviewConfig['extra']` OR `deleteExtraData` format if former is not set.

#### initialPreviewShowDelete
_bool_, whether the delete button will be displayed for each thumbnail that has been created with `initialPreview`.
Expand Down
4 changes: 2 additions & 2 deletions js/fileinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
self.$preview.find('.file-preview-frame').each(function () {
var $thumb = $(this), ind = $thumb.attr('data-fileindex'),
file = self.filestack[ind];
if (ind == -1) {
if (ind === -1) {
return;
}
if (file !== undefined) {
Expand Down Expand Up @@ -741,7 +741,7 @@
self.$preview.find('.kv-file-remove').each(function () {
var $el = $(this), $frame = $el.closest('.file-preview-frame'), index = $el.data('index'),
config = isEmpty(self.initialPreviewConfig[index]) ? null : self.initialPreviewConfig[index],
extraData = isEmpty(config) || isEmpty(config['extra']) ? deleteExtraData : config['extra'],
extraData = isEmpty(config) || isEmpty(config.extra) ? deleteExtraData : config.extra,
vUrl = $el.data('url') || self.deleteUrl, vKey = $el.data('key'), $content;
if (typeof extraData === "function") {
extraData = extraData();
Expand Down
4 changes: 2 additions & 2 deletions js/fileinput.min.js

Large diffs are not rendered by default.

0 comments on commit dd9a8de

Please sign in to comment.