From 8b5fcd3336f30e981a82c8b93f8de07429205fca Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Fri, 24 Feb 2017 09:30:49 +1300 Subject: [PATCH] Fix download file link works with the new TreeDropdown --- admin/client/dist/js/bundle.js | 2 +- admin/client/src/legacy/HtmlEditorField.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index 1354a869f..92e3ee77f 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -1844,7 +1844,7 @@ i&&(e+="#"+i) break case"anchor":e="#"+i break -case"file":var r=this.find(".ss-uploadfield .ss-uploadfield-item").attr("data-fileid") +case"file":var r=this.find(":input[name=file]").val() e=r?"[file_link,id="+r+"]":"" break case"email":e="mailto:"+this.find(":input[name=email]").val(),n&&(e+="?subject="+encodeURIComponent(n)),t=null diff --git a/admin/client/src/legacy/HtmlEditorField.js b/admin/client/src/legacy/HtmlEditorField.js index 2360aba20..9104ac97f 100644 --- a/admin/client/src/legacy/HtmlEditorField.js +++ b/admin/client/src/legacy/HtmlEditorField.js @@ -598,7 +598,7 @@ $.entwine('ss', function($) { break; case 'file': - var fileid = this.find('.ss-uploadfield .ss-uploadfield-item').attr('data-fileid'); + var fileid = this.find(':input[name=file]').val(); href = fileid ? '[file_link,id=' + fileid + ']' : ''; break;