Skip to content

Commit

Permalink
Fix tutorial positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-c committed Apr 15, 2013
1 parent 32950c7 commit 88e455a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions app/controllers/classifier.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ class Classifier extends Controller

@tutorial = new Tutorial
steps: tutorialSteps
parent: @el

Subject.bind 'select', @onSubjectSelect
Subject.bind 'no-subjects', @onNoLocalSubjects
User.bind 'sign-in', @onUserSignIn

$(window).on 'hashchange', =>
setTimeout @toggleTutorialVisibility

$(document).on 'keydown', @onKeyDown

KEYS =
Expand Down Expand Up @@ -109,14 +107,9 @@ class Classifier extends Controller
Subject.next() if doingTutorial or not Subject.current
else
getTutorialSubject().select()
@toggleTutorialVisibility()

toggleTutorialVisibility: =>
return unless !!@classification.subject.metadata.tutorial

if @el.is ':visible'
@tutorial.dialog.open()
else
@tutorial.dialog.close()
activate: ->
super
setTimeout => @tutorial.dialog.attach()

module.exports = Classifier
2 changes: 1 addition & 1 deletion css/tutorial.styl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
box-shadow: 0 0 0 5px rgba($black, 0.5);
color: $black;
font-size: 12px;
max-width: 300px;
width: 300px;
padding: 0 20px;
position: absolute;
transition: left 0.25s ease-out, top 0.25s ease-out 0.125s;
Expand Down

0 comments on commit 88e455a

Please sign in to comment.