I have a custom youtube plugin that adds an image to my tinyMCE editor and gets replaced with embedded or other code on the server side.
The only thing thats left is when I select the image in the editor, both the advImage icon and my plugin icon get set to active.
I want to set the advimage to non-active. I tried stuff like this:
cm.setActive('image', false);
Thanks to Thariama (see answer below) I know the correct name should be 'image'. This is called from my youtube plugin editor_plugin.js file, and in the console I can see that on selecting an image that code is executed and image is the correct target.
How do I set the image plugin to non-active?
See comments below Thariama’s answer for more information.
After this I let it be for a while because it was not on top of my priority list. Now it was the last thing on my list and because of working more with tinyMCE and it codes I pretty quickly found a solution.
I figured that I needed to go to the root: editor_template.js. This is were image was set to active so I needed to change that.
My images for youtube (and now vimeo as well) have an alt attribbute to tell me if it’s a youtube or vimeo video. Now I need to disable either one of those plugins as well.
I have put it on line 1117 after this code (which sets the active state for all img tags.
And my code: