mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Only create Controller when showing onboarding
This commit is contained in:
parent
bdee15128b
commit
d01d6a35cf
4 changed files with 116 additions and 118 deletions
|
@ -225,7 +225,7 @@ module.exports = ProjectController =
|
|||
if !user_id?
|
||||
return cb()
|
||||
timeout = setTimeout cb, 500
|
||||
AnalyticsManager.getLastOccurance user_id, "shown-track-changes-onboarding", (error, event) ->
|
||||
AnalyticsManager.getLastOccurance user_id, "shown-track-changes-onboarding-2", (error, event) ->
|
||||
clearTimeout timeout
|
||||
if error?
|
||||
return cb(null, false)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
div(ng-controller="FeatureOnboardingController")
|
||||
.feat-onboard(
|
||||
.feat-onboard(
|
||||
ng-controller="FeatureOnboardingController"
|
||||
ng-class="('feat-onboard-step' + onboarding.innerStep)"
|
||||
ng-if="!state.loading && showCollabFeaturesOnboarding"
|
||||
ng-if="!state.loading && ui.showCollabFeaturesOnboarding"
|
||||
ng-cloak
|
||||
stop-propagation="click"
|
||||
)
|
||||
)
|
||||
a.feat-onboard-dismiss(
|
||||
href
|
||||
ng-click="dismiss();"
|
||||
|
|
|
@ -73,6 +73,10 @@ define [
|
|||
}
|
||||
$scope.user = window.user
|
||||
|
||||
$scope.$watch "project.features.trackChangesVisible", (visible) ->
|
||||
return if !visible?
|
||||
$scope.ui.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible
|
||||
|
||||
$scope.shouldABTestPlans = false
|
||||
if $scope.user.signUpDate >= '2016-10-27'
|
||||
$scope.shouldABTestPlans = true
|
||||
|
|
|
@ -6,15 +6,9 @@ define [
|
|||
innerStep: 1
|
||||
nSteps: 4
|
||||
|
||||
$scope.$watch "project.features.trackChangesVisible", (visible) ->
|
||||
return if !visible?
|
||||
$scope.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible
|
||||
|
||||
$scope.dismiss = () ->
|
||||
event_tracking.sendMB "shown-track-changes-onboarding"
|
||||
$scope.$applyAsync(() -> $scope.showCollabFeaturesOnboarding = false)
|
||||
$(document).off "keydown", handleKeydown
|
||||
$(document).off "click", $scope.dismiss
|
||||
event_tracking.sendMB "shown-track-changes-onboarding-2"
|
||||
$scope.$applyAsync(() -> $scope.ui.showCollabFeaturesOnboarding = false)
|
||||
|
||||
$scope.gotoPrevStep = () ->
|
||||
if $scope.onboarding.innerStep > 1
|
||||
|
|
Loading…
Reference in a new issue