1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01: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 f821ec0658
commit 2bf8ffc320

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;
}