diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index b457f52235..a5d1e6e6ed 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -244,6 +244,8 @@ define [ scope.eventsBridge.emit "aceScrollbarVisibilityChanged", vRenderer.scrollBarV.isVisible, vRenderer.scrollBarV.width if scope.eventsBridge? + editor.renderer.on "scrollbarVisibilityChanged", onScrollbarVisibilityChanged + scope.eventsBridge.on "externalScroll", (position) -> editor.getSession().setScrollTop(position) scope.eventsBridge.on "refreshScrollPosition", () -> @@ -301,9 +303,9 @@ define [ # need to set annotations after attaching because attaching # deletes and then inserts document content session.setAnnotations scope.annotations - - session.on "changeScrollTop", onScroll - editor.renderer.on "scrollbarVisibilityChanged", onScrollbarVisibilityChanged + + if scope.eventsBridge? + session.on "changeScrollTop", onScroll setTimeout () -> # Let any listeners init themselves