mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
Debounce scrolling on editor
This commit is contained in:
parent
bf1bb25d06
commit
2ed9a17a66
@ -167,7 +167,6 @@
|
||||
this.initMarkdown();
|
||||
this.renderPreview();
|
||||
|
||||
// TODO: Debounce
|
||||
this.$('.CodeMirror-scroll').on('scroll', this.syncScroll);
|
||||
|
||||
// Shadow on Markdown if scrolled
|
||||
@ -200,7 +199,7 @@
|
||||
|
||||
},
|
||||
|
||||
syncScroll: function (e) {
|
||||
syncScroll: _.debounce(function (e) {
|
||||
var $codeViewport = $(e.target),
|
||||
$previewViewport = $('.entry-preview-content'),
|
||||
$codeContent = $('.CodeMirror-sizer'),
|
||||
@ -214,7 +213,7 @@
|
||||
|
||||
// apply new scroll
|
||||
$previewViewport.scrollTop(previewPostition);
|
||||
},
|
||||
}, 50),
|
||||
|
||||
// This updates the editor preview panel.
|
||||
// Currently gets called on every key press.
|
||||
|
Loading…
Reference in New Issue
Block a user