Allow to disable syncing scroll in side-by-side mode via options

This commit is contained in:
Tsubasa 2017-02-25 11:15:46 +09:00
parent b9071f0c91
commit 775e448518
3 changed files with 11 additions and 9 deletions

View file

@ -110,6 +110,7 @@ simplemde.value("This text will appear in the editor");
- **tabSize**: If set, customize the tab size. Defaults to `2`.
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
- **syncPreviewSideScroll**: If set to `false`, disable syncing scroll in side by side mode. Defaults to `true`.
```JavaScript
// Most options demonstrate the non-default behavior

18
dist/simplemde.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1667,6 +1667,7 @@ SimpleMDE.prototype.createSideBySide = function() {
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
}
if(this.options.syncPreviewSideScroll === false) return preview;
// Syncs scroll editor -> preview
var cScroll = false;
var pScroll = false;