tinymce-rails icon indicating copy to clipboard operation
tinymce-rails copied to clipboard

file_browser_callback should be function, being placed as string

Open bradlis7 opened this issue 8 years ago • 3 comments

I'm not sure how to get this to work. I tried <%= tinymce file_browser_callback: :fileBrowser %> and <%= tinymce file_browser_callback: 'fileBrowser' %>, but they are both outputting JS strings, but this is a callback function fileBrowser() {...} that exists elsewhere in javascript. Is there a secret to this, or would this have to be added as a special case configuration?

bradlis7 avatar Nov 30 '16 04:11 bradlis7

Maybe my answer is #62, though it's a bit of a hack, this works for now.

<%= tinymce file_browser_callback: "function() { return postsFileBrowser.apply(this, arguments); }" %>

bradlis7 avatar Nov 30 '16 04:11 bradlis7

Hi,

I would like to know what and where is the postsFileBrowser in the code.

juliatjoy avatar Jun 12 '17 11:06 juliatjoy

@juliatjoy IIRC, that was my own custom function which showed a modal window.

You might look at this article for more information: https://www.tinymce.com/docs-3x/howto/TinyMCE3x@How-to_implement_a_custom_file_browser/

bradlis7 avatar Jun 13 '17 20:06 bradlis7