The edit functionality in the WYSIWYG plugin has some strange behaviors, particularly without Media WYSIWYG View Mode enabled. I don't think the functionality is necessary for Media to support, and the plugin would be much more straightforward if it were simply removed, so the attached patch does that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cweagans’s picture

FileSize
1.46 KB
Devin Carlson’s picture

Status: Active » Needs review
cweagans’s picture

FileSize
1.51 KB

Got a little excited when I was deleting code and took out a line I shouldn't have.

cweagans’s picture

FileSize
1.6 KB

Adding @return on isNode() method.

Elijah Lynn’s picture

Status: Needs review » Needs work
+++ b/modules/media_wysiwyg/js/wysiwyg-media.js
@@ -16,11 +16,19 @@ Drupal.wysiwyg.plugins.media = {
+   * @return boolean
+   *   Whether or not this plugin "owns" the supplied DOM element.
    */
   isNode: function(node) {
-    return $(node).is('img[data-media-element]');
+    return false;

Technically it is @return bool. But I think in this case it is actually just @return false since it doesn't ever return true.

https://www.drupal.org/coding-standards/docs#types

Chris Matthews’s picture

Status: Needs work » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team