Disable/Enable

This example show how to disable and enable the editor.


Code

<!DOCTYPE html>
<html>
<head>
    <title>Article Editor</title>
    <meta charset="utf-8">

    <!-- css -->
    <link rel="stylesheet" href="/your-article-dist-path/article-editor.min.css" />
</head>
<body>
    <!-- element -->
    <textarea id="entry" disabled>
        <p>Content</p>
    </textarea>

    <!-- js -->
    <script src="/your-article-dist-path/article-editor.min.js"></script>

    <!-- call -->
    <script>
    var app = ArticleEditor('#entry', {
        css: '/your-article-dist-path/'
    });

    function enableEditor() {
        app.enable();
    }

    function disableEditor() {
        app.disable();
    }
    </script>
</body>
</html>

Usage

If textarea with content has the disabled attribute, the editor will start in disabled mode. You can also start the editor in disabled mode by specifying it in the setting:

ArticleEditor('#entry', {
    css: '/your-article-dist-path/',
    editor: {
        disabled: true
    }
});

To control the disabled mode state use API methods: