Documentation

Control

close #

Hide the shown control.

this.app.control.close();

add #

Arguments
name String
button Object

Add a button to the control.

ArticleEditor.add('plugin', 'myplugin', {
    start: function() {
        this.app.control.add('mybutton', {
            icon: '<i class="far fa-file-alt"></i>',
            command: 'myplugin.toggle'
        });
    },
    toggle: function(params, button) {
        // do something
    }
});

In this example, Font Awesome is used for the button icon. You can add your own HTML and SVG icon.

Now call the editor with the plugin created:

ArticleEditor('#entry', {
    plugins: ['myplugin'],
    css: '/your-article-dist-path/'
});

The button should appear in the control bar when you click on any block and when it pressed, will call the plugin's toggle method.

See more about the parameters of the buttons.

getElement #

Access to the Dom of the opened control element.

var $control = this.app.control.getElement();
$control.addClass('my-class');