diff --git a/services/web/app/views/project/editor/review-panel.pug b/services/web/app/views/project/editor/review-panel.pug index c0ac5dd75b..844e7946e4 100644 --- a/services/web/app/views/project/editor/review-panel.pug +++ b/services/web/app/views/project/editor/review-panel.pug @@ -51,22 +51,14 @@ ng-if="editor.wantTrackChanges === true" ) i.fa.fa-circle - span(ng-click="handleTrackChangesStateClick();", ng-if="editor.wantTrackChanges === false") !{translate("track_changes_is_off")} - span(ng-click="handleTrackChangesStateClick();", ng-if="editor.wantTrackChanges === true") !{translate("track_changes_is_on")} + span(ng-click="toggleFullTCStateCollapse();", ng-if="editor.wantTrackChanges === false") !{translate("track_changes_is_off")} + span(ng-click="toggleFullTCStateCollapse();", ng-if="editor.wantTrackChanges === true") !{translate("track_changes_is_on")} span.rp-tc-state-collapse( - ng-if="reviewPanel.isMultiUser" ng-class="{ 'rp-tc-state-collapse-on': reviewPanel.fullTCStateCollapsed }" ) i.fa.fa-angle-down - review-panel-toggle( - ng-if="!reviewPanel.isMultiUser" - ng-model="reviewPanel.trackChangesOnForEveryone" - on-toggle="toggleTrackChangesForEveryone(isOn);" - disabled="!project.features.trackChanges || !permissions.write" - ) ul.rp-tc-state( review-panel-collapse-height="reviewPanel.fullTCStateCollapsed" - ng-if="reviewPanel.isMultiUser" ) li.rp-tc-state-item.rp-tc-state-item-everyone span.rp-tc-state-item-name Everyone 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 c9cb9d8ea1..800e5aace8 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -34,7 +34,6 @@ define [ resolvedThreadIds: {} rendererData: {} formattedProjectMembers: {} - isMultiUser: false fullTCStateCollapsed: true loadingThreads: false # All selected changes. If a aggregated change (insertion + deletion) is selection, the two ids @@ -72,13 +71,11 @@ define [ $scope.$watch "project.members", (members) -> $scope.reviewPanel.formattedProjectMembers = {} - $scope.reviewPanel.isMultiUser = false if $scope.project?.owner? $scope.reviewPanel.formattedProjectMembers[$scope.project.owner._id] = formatUser($scope.project.owner) if $scope.project?.members? for member in members if member.privileges == "readAndWrite" - $scope.reviewPanel.isMultiUser = true $scope.reviewPanel.formattedProjectMembers[member._id] = formatUser(member) $scope.commentState = @@ -587,12 +584,6 @@ define [ $scope.gotoEntry = (doc_id, entry) -> ide.editorManager.openDocId(doc_id, { gotoOffset: entry.offset }) - $scope.handleTrackChangesStateClick = () -> - if $scope.reviewPanel.isMultiUser - $scope.toggleFullTCStateCollapse() - else - $scope.toggleTrackChangesForEveryone() - $scope.toggleFullTCStateCollapse = () -> if $scope.project.features.trackChanges reviewPanel.fullTCStateCollapsed = !reviewPanel.fullTCStateCollapsed @@ -641,7 +632,7 @@ define [ _setUserTCState(member._id, state[member._id] ? false) _setUserTCState($scope.project.owner._id, state[$scope.project.owner._id] ? false) - $scope.toggleTrackChangesForEveryone = (onForEveryone = !reviewPanel.trackChangesOnForEveryone) -> + $scope.toggleTrackChangesForEveryone = (onForEveryone) -> _setEveryoneTCState onForEveryone, true applyClientTrackChangesStateToServer()