Documentation

Control

$control #

Access to the Dom of the opened control element.

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

close #

Hide the shown control.

this.app.control.close();

add #

Arguments
name String
button Object

Add a button to the control.

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

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']
});

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.

get #

Arguments
name String

Get the specified button from the control.

var $button = this.app.control.get('duplicate');