Closed (won't fix)
Project:
FileField
Version:
6.x-3.10
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2012 at 03:31 UTC
Updated:
21 Aug 2015 at 16:00 UTC
Jump to comment: Most recent
Comments
Comment #1
drudrew commentedComment #2
drudrew commentedComment #3
iantresman commentedYes please, I've lost count of the number of times I've pressed the Remove button, thinking it is a Save button. When I have an image, Description field, Title Field, and extended Caption field, it is a lot of text (and image) to lose in a single click.
Comment #4
quicksketchHi guys, I probably won't be adding this directly to FileField, since this module is no longer receiving features. It should be possible to implement via an add-on module.
As @drudrew noted in the original posting, you can bind an additional handler to the mousedown() event. Then you can use http://api.jquery.com/event.stopImmediatePropagation/ to prevent the triggering of further handlers.
Comment #5
myhemant commentedHi,
Please try with this, Its working fine for me.
Create a copy of misc/ajax.js file and put it any custom module and by drupal_add_js() function.
Now modify the
Drupal.ajax = function (base, element, element_settings) { .... // function in beforeSend:
beforeSend: function (xmlhttprequest, options) {
if( ajax.url =='/?q=field_collection/ajax'){ // condition for when click on the Remove button for collection filed module.
if (confirm('Are you sure you want to remove this?')) {
ajax.ajaxing = true;
return ajax.beforeSend(xmlhttprequest, options);
}
xmlhttprequest.abort();
} else{
ajax.ajaxing = true;
return ajax.beforeSend(`xmlhttprequest`, options);
}
},
Comment #6
pwolanin commented