this.display = this.$refs.display;
this.input = this.$refs.input;
+ this.settingContainer = this.$refs.settingContainer;
this.editor = null;
initEditor({
toolbarLabel.closest('.markdown-editor-wrap').classList.add('active');
});
+ // Setting changes
+ this.settingContainer.addEventListener('change', e => {
+ const actualInput = e.target.parentNode.querySelector('input[type="hidden"]');
+ const name = actualInput.getAttribute('name');
+ const value = actualInput.getAttribute('value');
+ window.$http.patch('/preferences/update-boolean', {name, value});
+ // TODO - Update state locally
+ });
+
// Refresh CodeMirror on container resize
const resizeDebounced = debounce(() => this.editor.cm.refresh(), 100, false);
const observer = new ResizeObserver(resizeDebounced);