0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

guard against missing $previewContent/ViewPort in gh-editor.scrollPosition

issue #5659
- fixes occasional issue with editor not rendering due to scrollPosition being requested before the relevant jquery elements have been set
This commit is contained in:
Kevin Ansfield 2015-08-19 19:59:59 +01:00
parent 4e4de10e19
commit c07f33f5ad

View file

@ -41,7 +41,7 @@ export default Ember.Component.extend({
// scrollPosition value such that when either scrolling or typing-at-the-end of the text editor the preview pane
// stays in sync
scrollPosition: Ember.computed('editorScrollInfo', 'height', function () {
if (!this.get('editorScrollInfo')) {
if (!this.get('editorScrollInfo') || !this.get('$previewContent') || !this.get('$previewViewPort')) {
return 0;
}