-
-
Save Reinmar/84fddafd02bf17bd647c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afterInit: function(editor) { | |
if (editor.plugins.drupallink) { | |
var cmd = editor.getCommand( 'drupallink'); | |
// Needs to be refreshed on selection changes. | |
cmd.contextSensitive = 1; | |
// Disable command and cancel event when image is selected. | |
cmd.on('refresh', function(evt) { | |
var widget = editor.widgets.focused; | |
if (widget && widget.name=='image') { | |
this.setState(CKEDITOR.TRISTATE_DISABLED); | |
evt.cancel(); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment