What is the correct way to switch the state of the menu button of a ckeditor plugin based on selection?
For example, in the link / unlink plugin, I would only like to disconnect the link if the cursor is in the link.
editor.addCommand("unlink", { exec: function (editor) { //do something here }, refresh: function (editor, path) { // never seems to get fired. Is this even the right hook? } }); editor.ui.addButton("Unlink", { label: "Unlink", command: "unlink" });
Thanks for the help!
source share