jQuery Bug with File Upload
-
There appears to be an issue with the plugin where images uploaded via the File field are inserted into the admin DOM with only the class “event-manager-uploaded-file”, but around line 35 of wp-event-manager/js/admin.js the removal handler is bound to the “event-manager-uploaded-files” selector (note the trailing s). As a result, any files added dynamically cannot be removed.
jQuery(document).on("click", ".event-manager-remove-uploaded-file", function (e) {
e.preventDefault(); // Prevent default anchor behavior
var parentDiv = jQuery(this).closest(".event-manager-uploaded-files");
// Remove the preview span
parentDiv.find(".event-manager-uploaded-file-preview").remove();
// Clear the hidden input field value
parentDiv.find('input[type="hidden"]').val('');
});I made a Gist here for a hot fix until the plugin is updated: https://gist.github.com/mellinger/785d4902170328a716293a6657319771
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘jQuery Bug with File Upload’ is closed to new replies.