Currently media_wysiwyg.module uses class for determining if an HTML tag is a media element or not.
Some WYSIWYG editors really like to mess-up the classes (for example the styles dropdown from CKEditor). I replaced all instances of "media-element" class in JS with a data-media-element attribute and this seems to improve the integration between media and the WYSIWYG editor.
I've currently tested this approach with inline images, youtube and vimeo videos with custom "preview" view mode exposed by media_wysiwyg_view_mode.module.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | media-change_media_element_selector-2352163-1.patch | 3.4 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedDidn't test with this exact patch, but it should work.
Comment #2
Anonymous (not verified) commentedComment #3
mglamanWorks like a charm, and I agree this would be more dependable.
Tested against images and videos - our videos display a generated thumbnail within WYSIWYG, so it worked in advanced use case as well.
Comment #5
aaron commentedCommitted to http://drupalcode.org/project/media.git/commit/c18634a.