Problem/Motivation

We are developing a CKEditor widget that does not allow the markup generated here in some of its fields. We would like this plugin's button to be turned off when inside those fields.

Proposed resolution

Let's declare requiredContent so the editor can be aware of the incompatibility and turn the button off.

      const dialogCommand = new CKEDITOR.dialogCommand('quoteDialog');
      dialogCommand.requiredContent = 'blockquote';
      editor.addCommand('listicleheading', dialogCommand);
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

e0ipso created an issue. See original summary.

e0ipso’s picture

Status: Active » Needs review

This MR adds the necessary metadata so the editor button can be disabled in the appropriate contexts.

m4olivei made their first commit to this issue’s fork.

  • m4olivei committed 3d084e49 on 8.x-1.x authored by e0ipso
    Issue #3358124 by e0ipso: Declare requiredContent so other plugins can...
m4olivei’s picture

Status: Needs review » Fixed

Looks good to me.

Merged to 8.x-1.x 🎉

Status: Fixed » Closed (fixed)

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