Merge pull request #571 from sharelatex/sk-fully-hide-trackchanges

Sk fully hide trackchanges when not enabled
This commit is contained in:
Shane Kilkelly 2017-08-03 15:33:05 +01:00 committed by GitHub
commit cce2f93ab3
4 changed files with 14 additions and 5 deletions

View file

@ -90,8 +90,8 @@ script(type="text/ng-template", id="hotkeysModalTemplate")
span.combination Ctrl + Space
span.description Search References
h3 #{translate("review")}
.row
h3(ng-if="trackChangesVisible") #{translate("review")}
.row(ng-if="trackChangesVisible")
.col-xs-4
.hotkey
span.combination {{ctrl}} + J
@ -108,4 +108,4 @@ script(type="text/ng-template", id="hotkeysModalTemplate")
.modal-footer
button.btn.btn-default(
ng-click="cancel()"
) #{translate("ok")}
) #{translate("ok")}

View file

@ -90,6 +90,8 @@ define [
$scope.chat = {}
ide.toggleReviewPanel = $scope.toggleReviewPanel = () ->
if !$scope.project.features.trackChangesVisible
return
$scope.ui.reviewPanelOpen = !$scope.ui.reviewPanelOpen
event_tracking.sendMB "rp-toggle-panel", { value : $scope.ui.reviewPanelOpen }

View file

@ -10,13 +10,16 @@ define [
templateUrl: "hotkeysModalTemplate"
controller: "HotkeysModalController"
size: "lg"
resolve:
trackChangesVisible: () -> $scope.project.features.trackChangesVisible
}
App.controller "HotkeysModalController", ($scope, $modalInstance)->
App.controller "HotkeysModalController", ($scope, $modalInstance, trackChangesVisible)->
$scope.trackChangesVisible = trackChangesVisible
if ace.require("ace/lib/useragent").isMac
$scope.ctrl = "Cmd"
else
$scope.ctrl = "Ctrl"
$scope.cancel = () ->
$modalInstance.dismiss()
$modalInstance.dismiss()

View file

@ -416,6 +416,8 @@ define [
$scope.toggleReviewPanel()
$scope.addNewCommentFromKbdShortcut = () ->
if !$scope.project.features.trackChangesVisible
return
$scope.$broadcast "comment:select_line"
if !$scope.ui.reviewPanelOpen
$scope.toggleReviewPanel()
@ -575,6 +577,8 @@ define [
$scope.openTrackChangesUpgradeModal()
$scope.toggleTrackChangesFromKbdShortcut = () ->
if !$scope.project.features.trackChangesVisible
return
if $scope.editor.wantTrackChanges
$scope.toggleTrackChanges false
else