I am tinyMCE in my project.
I have two text area. I need to only show the controls for the active one. I had two options:
- Have a common control for both.
- Hide the controls of the inactive editor.
I couldn't figure out the first option. I went with the second approach.
Now I am able to trigger events when the editor in on focus. I need help with removing the menu and tools from the editor when it goes out of focus.
Here is the code as to how I am approaching the second option:
setup : function(ed) {
ed.on("focusout", function() {
tinyMCE.activeEditor.execCommand('mceSetAttribute','toolbar','false');
console.log(tinyMCE.activeEditor.execCommand('mceSetAttribute','toolbar','false'));
});
ed.on("focus", function() {
});
}