mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Handle track changles toggling when the feature is not enabled.
This commit is contained in:
parent
f50967295d
commit
8f9e43f339
3 changed files with 18 additions and 8 deletions
|
@ -20,12 +20,18 @@
|
|||
is-loading="reviewPanel.dropdown.loading"
|
||||
permissions="permissions"
|
||||
)
|
||||
span.review-panel-toolbar-label(ng-if="permissions.write", ng-click="fooBarBaz($event);")
|
||||
span.review-panel-toolbar-label(ng-if="permissions.write")
|
||||
span(ng-click="toggleTrackChanges(true)", ng-if="editor.wantTrackChanges === false") Track Changes is
|
||||
strong off
|
||||
span(ng-click="toggleTrackChanges(false)", ng-if="editor.wantTrackChanges === true") Track Changes is
|
||||
strong on
|
||||
review-panel-toggle(ng-if="editor.wantTrackChanges == editor.trackChanges", ng-model="editor.wantTrackChanges", on-toggle="toggleTrackChanges")
|
||||
review-panel-toggle(
|
||||
ng-if="editor.wantTrackChanges == editor.trackChanges"
|
||||
ng-model="editor.wantTrackChanges"
|
||||
on-toggle="toggleTrackChanges"
|
||||
disabled="!project.features.hasTrackChanges"
|
||||
on-disabled-click="openTrackChangesUpgradeModal"
|
||||
)
|
||||
span.review-panel-toolbar-label.review-panel-toolbar-label-disabled(ng-if="!permissions.write")
|
||||
span(ng-if="editor.wantTrackChanges === false") Track Changes is
|
||||
strong off
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
define [], () ->
|
||||
ONEHOUR = 1000 * 60 * 60
|
||||
class ConnectionManager
|
||||
|
|
|
@ -7,6 +7,10 @@ define [
|
|||
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout, $http, $modal, event_tracking) ->
|
||||
$reviewPanelEl = $element.find "#review-panel"
|
||||
|
||||
# TODO Mocked feature flag, remove.
|
||||
$scope.$on "project:joined", () ->
|
||||
$scope.project.features.hasTrackChanges = false
|
||||
|
||||
$scope.SubViews =
|
||||
CUR_FILE : "cur_file"
|
||||
OVERVIEW : "overview"
|
||||
|
@ -431,13 +435,12 @@ define [
|
|||
ide.editorManager.openDocId(doc_id, { gotoOffset: entry.offset })
|
||||
|
||||
$scope.toggleTrackChanges = (value) ->
|
||||
if true # TODO check feature/permission
|
||||
$scope.openTrackChangesUpgradeModal()
|
||||
return
|
||||
|
||||
if $scope.project.features.hasTrackChanges
|
||||
$scope.editor.wantTrackChanges = value
|
||||
$http.post "/project/#{$scope.project_id}/track_changes", {_csrf: window.csrfToken, on: value}
|
||||
event_tracking.sendMB "rp-trackchanges-toggle", { value }
|
||||
else
|
||||
$scope.openTrackChangesUpgradeModal()
|
||||
|
||||
ide.socket.on "toggle-track-changes", (value) ->
|
||||
$scope.$apply () ->
|
||||
|
|
Loading…
Reference in a new issue