From 9503307cbf722acd45b55e764e6e0c270cf0c766 Mon Sep 17 00:00:00 2001 From: Evan Theurer Date: Wed, 8 Oct 2014 18:08:33 +0200 Subject: [PATCH] Add flag to localStorage to hide help tour when already shown. --- static/js/directives/helptour.js | 13 ++++++++----- static/partials/helptour.html | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/static/js/directives/helptour.js b/static/js/directives/helptour.js index ed86c4ab..2c72647d 100644 --- a/static/js/directives/helptour.js +++ b/static/js/directives/helptour.js @@ -24,8 +24,9 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html //helptour return [function() { - var controller = ['$scope', '$rootScope', '$timeout', 'mediaStream', '$modal', function($scope, $rootScope, $timeout, mediaStream, $modal) { + var controller = ['$scope', '$timeout', '$modal', 'userSettingsData', function($scope, $timeout, $modal, userSettingsData) { var displayTime = 500; + var shown = localStorage.getItem('mediastream-helptour'); var doStep = function(i, elem) { $timeout(function() { $(elem).addClass('in'); @@ -41,8 +42,8 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html }; var introTour = function() { $scope.layout.settings = false; - var controller = ['$scope', '$modalInstance', function($scope, $modalInstance) { - $scope.goTour = function() { + var controller = ['$scope', '$modalInstance', function(scope, $modalInstance) { + scope.goTour = function() { $modalInstance.dismiss(); startTour(); }; @@ -50,11 +51,13 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html $modal.open({ template: templatehelptour, controller: controller, - resolve: {}, size: 'sm' }); }; - introTour(); + if (!shown) { + introTour(); + localStorage.setItem('mediastream-helptour', true); + } $scope.$on('showHelpTour', function(current, last) { if(current) { introTour(); diff --git a/static/partials/helptour.html b/static/partials/helptour.html index 228c2fc0..f9e0ae2a 100644 --- a/static/partials/helptour.html +++ b/static/partials/helptour.html @@ -4,12 +4,12 @@