diff --git a/src/Jodit.ts b/src/Jodit.ts index 81beb0734..dbe0d7f87 100644 --- a/src/Jodit.ts +++ b/src/Jodit.ts @@ -214,7 +214,10 @@ export class Jodit extends Component { this.toolbar = new ToolbarCollection(this); - this.toolbar.build(this.options.buttons.concat(this.options.extraButtons), this.container); + + if (this.options.toolbar) { + this.toolbar.build(this.options.buttons.concat(this.options.extraButtons), this.container); + } this.container.classList.add('jodit_toolbar_size-' + (['middle', 'large', 'small'].indexOf(this.options.toolbarButtonSize.toLowerCase()) !== -1 ? this.options.toolbarButtonSize.toLowerCase() : 'middle')); diff --git a/src/plugins/mobile.ts b/src/plugins/mobile.ts index 4450d7b0c..0c418b0f9 100644 --- a/src/plugins/mobile.ts +++ b/src/plugins/mobile.ts @@ -80,6 +80,10 @@ export function mobile(editor: Jodit) { }); }) .on('resize afterInit', () => { + if (!editor.options.toolbar) { + return; + } + let width: number = editor.container.offsetWidth; if (width >= editor.options.sizeLG) { diff --git a/test/tests/interfaceTest.js b/test/tests/interfaceTest.js index 500bd2be2..0dc14f205 100644 --- a/test/tests/interfaceTest.js +++ b/test/tests/interfaceTest.js @@ -1,6 +1,14 @@ describe('Test interface', function() { appendTestArea('table_editor_interface', true); describe('Toolbar', function () { + describe('Set toolbar options to false', function () { + it('Should hide toolbar', function () { + var editor = new Jodit(appendTestArea(), { + toolbar: false + }); + expect(null).to.be.equal(editor.container.querySelector('jodit_toolbar')); + }); + }); describe('Popups', function () { describe('Click on some link', function () { describe('in the left side of editor', function () {