TinyMCE 4 toggle toolbar button state

后端 未结 4 1411
轻奢々
轻奢々 2021-01-03 08:39

What is the simplest way to toggle the state of a toolbar button (like it works with the default bold-button)? I can\'t \"get\" to that class i Tinymce that changes the butt

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 09:17

    First fire statechange in your command:

    editor.fire('FullscreenStateChanged', {state: fullscreenState});
    

    On button onPostRender change button state:

    onPostRender: function() {
        var self = this;
    
        editor.on('FullscreenStateChanged', function(e) {
            self.active(e.state);
        });
    }
    

提交回复
热议问题