Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ results
npm-debug.log
node_modules
.build*

.idea/*
9 changes: 7 additions & 2 deletions tutorial.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class @TutorialManager
@buildActionDeps()

buildActionDeps: ->
self = @
@actionDeps = []
for i, step of @steps
if step.require
Expand All @@ -57,9 +58,13 @@ class @TutorialManager
# Bind validator dep in closure
val = validator
d = dep
autoContinue = step.require.autoContinue
stepIndex = self.steps.indexOf step
return ->
actionCompleted = if val then val.apply(this, arguments) else true
if actionCompleted
if stepIndex == self.step && autoContinue
self.next()
d.completed = true
d.changed()
)()
Expand Down Expand Up @@ -147,9 +152,9 @@ class @TutorialManager
elWidth = $el.outerWidth() || parseInt($el.attr("width"))
elHeight = $el.outerHeight() || parseInt($el.attr("height"))
offset = $el.offset()

hull.top = Math.min(hull.top, offset.top)
hull.left = Math.min(hull.left, offset.left)
hull.left = Math.min(hull.left, offset.left)
hull.bottom = Math.min(hull.bottom, $(window).height() - offset.top - elHeight)
hull.right = Math.min(hull.right, $(window).width() - offset.left - elWidth)

Expand Down