Skip to content

Commit

Permalink
FIX: Editing existing file links in HtmlEditorField was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Sep 10, 2015
1 parent 6ad277c commit 6056e9c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions javascript/HtmlEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,11 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
} else if(el.is(':radio')) {
el.val([selected]).change();
} else if(fieldName == 'file') {
// Can't rely on fieldName, ad UploadFields have different naming convention
el = $('#' + fieldName);

// UploadField inputs have a slightly different naming convention
el = this.find(':input[name="' + fieldName + '[Uploads][]"]');
// We need the UploadField "field", not just the input
el = el.parents('.ss-uploadfield');

// We have to wait for the UploadField to initialise
(function attach(el, selected) {
if( ! el.getConfig()) {
Expand Down

0 comments on commit 6056e9c

Please sign in to comment.