From 85ba918a54f51dd524d45f2c93172a18421ae3bf Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Mon, 11 Jan 2016 16:37:27 +0000 Subject: [PATCH] FIX: Update field IDs for file link (fixes silverstripe/silverstripe-cms#1307) --- javascript/HtmlEditorField.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 944618d4d..6ccaed14d 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -667,12 +667,13 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; resetFileField: function() { // 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'), currentItem = fileField.find('.ss-uploadfield-item[data-fileid]'); if(currentItem.length) { - fileUpload._trigger('destroy', null, {content: currentItem}); + fileUpload._trigger('destroy', null, {context: currentItem}); + fileField.find('.ss-uploadfield-addfile').removeClass('borderTop'); } },