Merge pull request #4908 from kinglozzer/cms-1307-filelink-field

FIX: Update field IDs for file link (fixes silverstripe/silverstripe-cms#1307)
This commit is contained in:
Damian Mooyman 2016-01-12 11:01:49 +13:00
commit aac59a85ff

View File

@ -667,12 +667,13 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
resetFileField: function() { resetFileField: function() {
// If there's an attached item, remove it // If there's an attached item, remove it
var fileField = this.find('#file'), var fileField = this.find('.ss-uploadfield[id$="file_Holder"]'),
fileUpload = fileField.data('fileupload'), fileUpload = fileField.data('fileupload'),
currentItem = fileField.find('.ss-uploadfield-item[data-fileid]'); currentItem = fileField.find('.ss-uploadfield-item[data-fileid]');
if(currentItem.length) { if(currentItem.length) {
fileUpload._trigger('destroy', null, {content: currentItem}); fileUpload._trigger('destroy', null, {context: currentItem});
fileField.find('.ss-uploadfield-addfile').removeClass('borderTop');
} }
}, },