Skip to content

Commit

Permalink
Merge pull request #14 from threadi/feature/doNotSendEmptyListToSave
Browse files Browse the repository at this point in the history
do not send empty list to save
  • Loading branch information
threadi authored Jan 14, 2024
2 parents 90d6b11 + 3f217ec commit f5c9788
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jQuery(document).ready(function($) {
// get field value
let urls = $(this).parent().find('.eml_add_external_files').val();

// do nothing if list is empty.
if( urls.length === 0 ) {
return;
}

// send request
jQuery.ajax({
url: emlJsVars.ajax_url,
Expand Down Expand Up @@ -88,4 +93,4 @@ jQuery(document).ready(function($) {
$this.closest('div[data-dismissible]').hide('slow');
}
);
});
});
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ No, only public files can be used.
= 1.0.2 =
* Added hook documentation
* Added hint for hook documentation in settings
* Optimized handling of upload-form if nothing has been added there
* Removed language files from release

0 comments on commit f5c9788

Please sign in to comment.