el: document.querySelector('#editor'),
initialEditType: 'wysiwyg',
previewStyle: 'vertical',
+ cursorToEnd: false,
+ autofocus: false,
toolbarItems: [
['heading', 'bold', 'italic'],
['hr', 'quote'],
setCurrentState: function (state,scroll) {
MARKDOWN_DATA[this.currentPage] = state
- this.editor.reset()
- this.editor.insertText(state)
- this.editor.blur()
-
- this.editor.setScrollTop(20)
+ const editorElement = $(".toastui-editor-md-preview")[0];
+ const scrollTop = editorElement.scrollTop;
+ this.editor.moveCursorToEnd(false);
+ this.editor.setMarkdown(state, false);
+ this.editor.moveCursorToEnd(false);
+ this.editor.getCurrentModeEditor().blur();
//this.editor.moveCursorToStart(true)
},
<div class="markdown-revision-nav">
<a href="#" id="linkeditor-icon-versions" data-panel="form" data-icon="wayback-machine"
data-action="toggleRevisions"
- data-action-args="true"
data-tooltip="{{__('Paramètres du lien')}} (F8)" data-key="f8"></a>
</div>
<div class="markdown-revision-panel">
var TRANSLATIONS = @json($translations);
var FLUIDBOOK_DATA = @json($fbdata);
var MARKDOWN_DATA = @json($contents);
- console.log(MARKDOWN_DATA)
</script>
<script
src="/packages/markdowneditor/js/markdowneditor.js?v={{filemtime(public_path('packages/markdowneditor/js/markdowneditor.js'))}}"></script>