From 42ab2e816596d6c05d20d9c484e2c567557234f5 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 13 Oct 2016 12:21:49 +0100 Subject: [PATCH] Init review panel with ace editor height --- .../public/coffee/ide/editor/directives/aceEditor.coffee | 8 ++++++-- .../review-panel/controllers/ReviewPanelController.coffee | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index e4cd18c7ec..4a697f39f9 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -234,8 +234,6 @@ define [ doc = session.getDocument() doc.on "change", onChange - - session.on "changeScrollTop", onScroll sharejs_doc.on "remoteop.recordForUndo", () => undoManager.nextUpdateIsRemote = true @@ -243,9 +241,15 @@ define [ editor.initing = true sharejs_doc.attachToAce(editor) editor.initing = false + # need to set annotations after attaching because attaching # deletes and then inserts document content session.setAnnotations scope.annotations + + session.on "changeScrollTop", onScroll + setTimeout () -> + # Let any listeners init themselves + onScroll(editor.renderer.getScrollTop()) editor.focus() diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index 58f4c7d91f..44704b2daa 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -45,4 +45,4 @@ define [ deltaY = e.wheelY # console.log "mousewheel", deltaY scroller.scrollTop(scroller.scrollTop() + deltaY * 4) - e.preventDefault() \ No newline at end of file + e.preventDefault()