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

View file

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