How do I properly disable/enable an editor button?

.
While you’re waiting for the experts to arrive, you might want to look at this:

Where are editor JavaScript functions defined? - Add-ons - Anki Forums (ankiweb.net)

There seems to be a suggestion that some functions might be missing in editor.py

Thanks