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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SchnWalter’s picture

Didn't test with this exact patch, but it should work.

SchnWalter’s picture

Status: Active » Needs review
mglaman’s picture

Assigned: SchnWalter » Unassigned
Status: Needs review » Reviewed & tested by the community

Works 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.

  • aaron committed c18634a on 7.x-2.x
    Issue #2352163 by SchnWalter: fixed media_wysiwyg replace class selector...
aaron’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.