Add setting saving logic.

This commit is contained in:
Paulo Reis 2016-10-24 12:20:08 +01:00
parent 4d33b11ce5
commit 32d59b6212

View file

@ -1,17 +1,23 @@
define [
"base"
], (App) ->
App.controller "FeatureOnboardingController", ($scope, $modal, event_tracking) ->
App.controller "FeatureOnboardingController", ($scope, settings) ->
$scope.isFeatureSettingDefined = window.userSettings.syntaxValidation?;
$scope.innerStep = 1
$scope.turnCodeCheckOn = () ->
settings.saveProjectSettings({ syntaxValidation: true })
navToInnerStep2()
$scope.turnCodeCheckOn = () ->
settings.saveProjectSettings({ syntaxValidation: false })
navToInnerStep2()
$scope.dismiss = () ->
# TODO Toggle logic.
$scope.isFeatureSettingDefined = false
navToInnerStep2 = () ->
$scope.innerStep = 2
$scope.ui.leftMenuShown = true