From 4bba8e89773da22203a8cd4a52b8ffb1629787ca Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 17 Nov 2016 10:51:17 +0000 Subject: [PATCH] Remove deprecated event handlers, conditionally add the new ones in the Ace wrapper directive. --- .../public/coffee/ide/editor/directives/aceEditor.coffee | 8 +++++--- .../review-panel/controllers/ReviewPanelController.coffee | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 33d1039a03..a97d836d6e 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) @@ -297,9 +299,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 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 89319d2e5e..fe9566870d 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -19,10 +19,6 @@ define [ adding: false content: "" - # DEPRECATED Used to communicate between Ace and reviewPanelSorted directive - $scope.scrollBindings = - reviewPanelEvents: new EventEmitter() - $scope.reviewPanelEventsBridge = new EventEmitter() changesTrackers = {}