From aa58b70d43ea225b02565bcb741056f0db041d22 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 31 Oct 2016 20:18:08 +0000 Subject: [PATCH] Improve visibility logic. --- .../app/views/project/editor/feature-onboarding.jade | 10 +++++----- services/web/public/coffee/ide.coffee | 1 + .../coffee/ide/FeatureOnboardingController.coffee | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/services/web/app/views/project/editor/feature-onboarding.jade b/services/web/app/views/project/editor/feature-onboarding.jade index eb075cc843..3a46b05a36 100644 --- a/services/web/app/views/project/editor/feature-onboarding.jade +++ b/services/web/app/views/project/editor/feature-onboarding.jade @@ -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 \ No newline at end of file + button.btn.btn-primary(ng-click="dismiss();") OK, got it \ No newline at end of file diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index fdb1a2804b..bfe5f12f51 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -65,6 +65,7 @@ define [ view: "editor" chatOpen: false pdfLayout: 'sideBySide' + showCodeCheckerOnboarding: true } $scope.user = window.user diff --git a/services/web/public/coffee/ide/FeatureOnboardingController.coffee b/services/web/public/coffee/ide/FeatureOnboardingController.coffee index 19fa30d579..51e62b0ea7 100644 --- a/services/web/public/coffee/ide/FeatureOnboardingController.coffee +++ b/services/web/public/coffee/ide/FeatureOnboardingController.coffee @@ -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