Fixed clue access (only show if dashboard is shown).

This commit is contained in:
Martin Edenhofer 2016-02-03 21:44:47 +01:00
parent edd9b42fdf
commit 2500c772eb
2 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,5 @@
class App.Dashboard extends App.Controller class App.Dashboard extends App.Controller
clueAccess: true
events: events:
'click .tabs .tab': 'toggle' 'click .tabs .tab': 'toggle'
'click .intro': 'clues' 'click .intro': 'clues'
@ -7,7 +8,7 @@ class App.Dashboard extends App.Controller
super super
if @isRole('Customer') if @isRole('Customer')
@navigate '#', true @clueAccess = false
return return
# render page # render page
@ -37,12 +38,15 @@ class App.Dashboard extends App.Controller
) )
mayBeClues: => mayBeClues: =>
return if !@clueAccess
return if !@activeState
preferences = @Session.get('preferences') preferences = @Session.get('preferences')
@clueAccess = false
return if preferences['intro'] return if preferences['intro']
return if !@el.is(':visible')
@clues() @clues()
clues: (e) => clues: (e) =>
@clueAccess = false
if e if e
e.preventDefault() e.preventDefault()
new App.FirstStepsClues( new App.FirstStepsClues(
@ -70,6 +74,10 @@ class App.Dashboard extends App.Controller
show: (params) => show: (params) =>
if @isRole('Customer')
@navigate '#', true
return
# set title # set title
@title 'Dashboard' @title 'Dashboard'

View file

@ -238,7 +238,7 @@ class TestCase < Test::Unit::TestCase
=end =end
def clues_close(params) def clues_close(params = {})
switch_window_focus(params) switch_window_focus(params)
log('clues_close', params) log('clues_close', params)