How to use the tinymce/tinymce.remove function in tinymce

To help you get started, we’ve selected a few tinymce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github orchidsoftware / platform / resources / js / controllers / fields / tinymce_controller.js View on Github external
const selector = this.element.querySelector('.tinymce').id;
        const input = this.element.querySelector('input');

        let plugins = 'image media table link paste contextmenu textpattern autolink codesample';
        let toolbar1 = '';
        let inline = true;

        if (this.element.dataset.theme === 'modern') {
            plugins = 'print autosave autoresize preview paste code searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern';
            toolbar1 = 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | ltr rtl';
            inline = false;
        }

        // for remove cache
        tinymce.remove(`#${selector}`);

        tinymce.init({
            branding: false,
            selector: `#${selector}`,
            theme: this.element.dataset.theme,
            min_height: 300,
            height: 300,
            max_height: 600,
            plugins,
            toolbar1,
            insert_toolbar: 'quickimage quicktable media codesample fullscreen',
            selection_toolbar:
                'bold italic | quicklink h2 h3 blockquote | alignleft aligncenter alignright alignjustify | outdent indent | removeformat ',
            inline,
            convert_urls: false,
            image_caption: true,
github rinvex / cortex / resources / js / app.js View on Github external
document.addEventListener('turbolinks:before-cache', function() {
    TinyMCE.remove();

    window.selectedCountry = null;
    window.selectedCountries = null;

    $('.select2')
        .select2()
        .each(function(i, item) {
            $(item).select2('destroy');
        });

    // $('.dataTableBuilder').each(function(i, item){
    //     $(item).DataTable().destroy();
    // });
});
github orchidsoftware / platform / resources / js / controllers / fields / tinymce_controller.js View on Github external
disconnect() {
        tinymce.remove(`#${this.element.querySelector('.tinymce').id}`);
    }
}
github onespacemedia / project-template / {{cookiecutter.repo_name}} / {{cookiecutter.package_name}} / assets / js / frontend-editing / editable.js View on Github external
this.saveButton.addEventListener('click', () => {
        tinymce.remove(`#${this.el.getAttribute('id')}`)
        this.saveButtonContainer.parentNode.removeChild(this.saveButtonContainer)

        this.sendData()
      })
    })
github Automattic / wp-calypso / client / extensions / woocommerce / components / compact-tinymce / index.js View on Github external
destroyEditor() {
		if ( this.editor ) {
			forEach( [ 'change', 'keyup', 'setcontent', 'init' ], eventName => {
				this.editor.off( eventName );
			} );
		}

		this.editorContainer && tinymce.remove( this.editorContainer );
		this.editor = null;
		this.editorContainer = null;
	}
github keystonejs / keystone / packages / fields-wysiwyg-tinymce / src / views / Editor.js View on Github external
return () => {
      tinymce.remove(editorRef.current);
    };
  }, [plugins, toolbar]);
github Automattic / wp-calypso / client / components / tinymce / index.jsx View on Github external
destroyEditor = () => {
		forEach(
			EVENTS,
			function( eventHandler, eventName ) {
				if ( this.props[ eventHandler ] ) {
					this._editor.off( eventName, this.props[ eventHandler ] );
				}
			}.bind( this )
		);

		tinymce.remove( this._editor );
		this._editor = null;
		autosize.destroy( this.textInput.current );
	};