mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-17 05:42:06 +00:00
Added md editor ui dropdown options & their back-end storage
Still need to perform actual in-editor functionality for those controls.
This commit is contained in:
parent
3995b01399
commit
9fd5190c70
6 changed files with 59 additions and 1 deletions
resources/js/components
|
@ -14,6 +14,7 @@ export class MarkdownEditor extends Component {
|
|||
|
||||
this.display = this.$refs.display;
|
||||
this.input = this.$refs.input;
|
||||
this.settingContainer = this.$refs.settingContainer;
|
||||
|
||||
this.editor = null;
|
||||
initEditor({
|
||||
|
@ -74,6 +75,15 @@ export class MarkdownEditor extends Component {
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue