From 85c2910738dd105e01f828451245e546fa934af8 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 13 Feb 2017 09:49:51 +0100 Subject: [PATCH] Don't animate review panel entries on toggle and resize --- .../controllers/ReviewPanelController.coffee | 4 ++-- .../review-panel/directives/reviewPanelSorted.coffee | 10 +++++++--- .../public/stylesheets/app/editor/review-panel.less | 6 ++++++ 3 files changed, 15 insertions(+), 5 deletions(-) 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 36c56890cc..c36c881e3c 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -33,7 +33,7 @@ define [ $scope.$on "layout:pdf:resize", (event, state) -> $scope.reviewPanel.layoutToLeft = (state.east?.size < 220 || state.east?.initClosed) - $scope.$broadcast "review-panel:layout" + $scope.$broadcast "review-panel:layout", false $scope.$on "expandable-text-area:resize", (event) -> $timeout () -> @@ -154,7 +154,7 @@ define [ return if !reviewPanelOpen? $timeout () -> $scope.$broadcast "review-panel:toggle" - $scope.$broadcast "review-panel:layout" + $scope.$broadcast "review-panel:layout", false regenerateTrackChangesId = (doc) -> old_id = getChangeTracker(doc.doc_id).getIdSeed() diff --git a/services/web/public/coffee/ide/review-panel/directives/reviewPanelSorted.coffee b/services/web/public/coffee/ide/review-panel/directives/reviewPanelSorted.coffee index 2bd66c723e..4028406713 100644 --- a/services/web/public/coffee/ide/review-panel/directives/reviewPanelSorted.coffee +++ b/services/web/public/coffee/ide/review-panel/directives/reviewPanelSorted.coffee @@ -6,7 +6,11 @@ define [ link: (scope, element, attrs) -> previous_focused_entry_index = 0 - layout = () -> + layout = (animate = true) -> + if animate + element.removeClass("no-animate") + else + element.addClass("no-animate") sl_console.log "LAYOUT" if scope.ui.reviewPanelOpen PADDING = 8 @@ -101,9 +105,9 @@ define [ scope.$applyAsync () -> layout() - scope.$on "review-panel:layout", () -> + scope.$on "review-panel:layout", (e, animate = true) -> scope.$applyAsync () -> - layout() + layout(animate) scope.$watch "reviewPanel.rendererData.lineHeight", () -> layout() diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index 1bac7faf6f..65875af6ac 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -184,6 +184,9 @@ color: #FFF; cursor: pointer; transition: top 0.3s, left 0.1s, right 0.1s; + .no-animate & { + transition: none; + } &-focused { left: 0px; @@ -277,6 +280,9 @@ border-radius: 3px; background-color: #FFF; transition: top 0.3s, left 0.1s, right 0.1s; + .no-animate & { + transition: none; + } &-insert { border-color: @rp-green;