]> BookStack Code Mirror - bookstack/blob - resources/js/components/wysiwyg-input.js
ad964aed2c4656fbca7bd4e6bee57c0e344e127c
[bookstack] / resources / js / components / wysiwyg-input.js
1 import {Component} from './component';
2 import {buildForInput} from '../wysiwyg/config';
3
4 export class WysiwygInput extends Component {
5
6     setup() {
7         this.elem = this.$el;
8
9         const config = buildForInput({
10             language: this.$opts.language,
11             containerElement: this.elem,
12             darkMode: document.documentElement.classList.contains('dark-mode'),
13             textDirection: this.$opts.textDirection,
14             translations: {},
15             translationMap: window.editor_translations,
16         });
17
18         window.tinymce.init(config).then(editors => {
19             this.editor = editors[0];
20         });
21     }
22
23 }