Sync editor and preview when preview is updated.

This commit is contained in:
Guo Xiang Tan 2017-11-29 11:17:30 +08:00
parent 03eb278034
commit 5b965ab5d0
2 changed files with 3 additions and 9 deletions

View File

@ -144,14 +144,6 @@ export default Ember.Component.extend({
$input.on('scroll', () => {
this._syncScroll(this._syncEditorAndPreviewScroll, $input, $preview);
});
$input.on('keypress', () => {
Ember.run.debounce(
this,
this._syncScroll, this._syncEditorAndPreviewScroll, $input, $preview,
200
);
});
});
$preview.on('touchstart mouseenter', () => {
@ -727,6 +719,7 @@ export default Ember.Component.extend({
Ember.run.debounce(this, this._loadInlineOneboxes, inline, 450);
}
this._syncScroll(this._syncEditorAndPreviewScroll, this.$('.d-editor-input'), $preview);
this.trigger('previewRefreshed', $preview);
this.sendAction('afterRefresh', $preview);
},

View File

@ -11,7 +11,8 @@
validation=validation
loading=composer.loading
forcePreview=forcePreview
composerEvents=true}}
composerEvents=true
autofocus=true}}
{{#if site.mobileView}}
<input type="file" id="mobile-uploader" multiple />