[wp-hackers] Javascript bind event for 3.5's new uploader?
Luke Bryan
lukebryan at sharefaith.com
Sat Dec 29 05:04:27 UTC 2012
Thanks for the helpful reply. I've noticed a problem in more complex
cases, though.
I was using the wp.media.editor.add('content') to access the editor on
the wp-admin. Unfortunately on pages that don't have that editor, but
a different editor, it will mess up the editor's uploader. Something
went wrong in the code, and $index was undefined when I tried to
upload a new file - file didn't upload.
Checking for existence of wp.media.editor.get('content') and using it,
solves this problem, but I noticed another...
After calling up the single-file-upload-selector, (the same way
custom-background.js does), uploading and then showing a new
mce-editor, I found that the mce-editor's uploader fails to upload a
new file.
I haven't found much documentation on the wp.media objects, I was
wondering if there is yet any detailed documentation on the Javascript
events, and/or what is required to handle these Backbone.js objects
when creating and removing multiple tinyMCE editors?
Best regards,
Luke
More information about the wp-hackers
mailing list