Improve visibility logic.

This commit is contained in:
Paulo Reis 2016-10-31 20:18:08 +00:00
parent 31697bd1e2
commit aa58b70d43
3 changed files with 10 additions and 8 deletions

View file

@ -1,7 +1,7 @@
.feat-onboard(
ng-controller="FeatureOnboardingController"
ng-class="('feat-onboard-step' + innerStep)"
ng-if="!state.loading && !isFeatureSettingDefined"
ng-if="!state.loading && ui.showCodeCheckerOnboarding"
ng-cloak
)
.feat-onboard-wrapper
@ -29,11 +29,11 @@
span.feat-onboard-adv-title-highlight brackets
p Lorem ipsum feature description stuff.
.feat-onboard-btn-wrapper
.btn.btn-primary(ng-click="turnCodeCheckOn();") Yes, turn Code check on
button.btn.btn-primary(ng-click="turnCodeCheckOn();") Yes, turn Code check on
.feat-onboard-btn-wrapper
.btn.btn-default(ng-click="turnCodeCheckOn();") No, disable it for now
button.btn.btn-default(ng-click="turnCodeCheckOn();") No, disable it for now
div(ng-if="innerStep === 2;")
p
p.feat-onboard-description
| Remember: you can always turn 
span.feat-onboard-description-name Code check 
em on 
@ -41,4 +41,4 @@
em off 
|, in the settings menu.
.feat-onboard-btn-wrapper
.btn.btn-primary(ng-click="dismiss();") OK, got it
button.btn.btn-primary(ng-click="dismiss();") OK, got it

View file

@ -65,6 +65,7 @@ define [
view: "editor"
chatOpen: false
pdfLayout: 'sideBySide'
showCodeCheckerOnboarding: true
}
$scope.user = window.user

View file

@ -2,20 +2,21 @@ define [
"base"
], (App) ->
App.controller "FeatureOnboardingController", ($scope, settings) ->
$scope.isFeatureSettingDefined = window.userSettings.syntaxValidation?;
$scope.innerStep = 1
$scope.turnCodeCheckOn = () ->
settings.saveSettings({ syntaxValidation: true })
scope.settings.syntaxValidation = true
navToInnerStep2()
$scope.turnCodeCheckOn = () ->
settings.saveSettings({ syntaxValidation: false })
scope.settings.syntaxValidation = false
navToInnerStep2()
$scope.dismiss = () ->
$scope.isFeatureSettingDefined = true
$scope.ui.leftMenuShown = false
$scope.ui.showCodeCheckerOnboarding = false
navToInnerStep2 = () ->
$scope.innerStep = 2