To expand: I'd like to utilize the same Modal code/appearance ( as used in wp.media.Modal, wp.media.FocusManager ) to open a modal of my own custom dialog, not the Media Editor. In the past, I've used thickbox for this sort of thing, but wp.media.Modal appears to be the way of the future for modals -- Not to mention it looks cool.
I've poked at the JS source a bit and have come to a couple possible solutions:
- "Borrow" the code media-views.js and use it in my plugin.
- "Extend" wp.media.Modal ( it is a Backbone View, after all ).
- Create a custom implementation, jQueryUI, etc.
- Just give up and use thickbox.
Borrowing seems slightly less dangerous than using wp.media.Model.extend({}), but wasteful. I'm not a big fan of jQueryUI's modals, but it would get the job done. At the same time, I could do a custom implementation of modals ( or base it off another lib ).
Feels like I'm missing something obvious: Has anyone else pulled this off or is the new media library modal code "too new" to allow for reuse?