Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ $scope.onboardingSteps = [
position: "right",
description: "This is the form for configuring your account.",
attachTo: "#account_form",
position: "bottom"
position: "bottom",
nextFunction: function nextClick () { alert('Next btn clicked') },
prevFunction: function prevClick () { alert('prev button clicked') }
}
];
```
Expand Down
12 changes: 9 additions & 3 deletions src/ng-onboarding.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ app.directive 'onboardingPopover', ['ngOnboardingDefaults', '$sce', '$timeout',
link: (scope, element, attrs) ->
# Important Variables
curStep = null
attributesToClear = ['title', 'top', 'right', 'bottom', 'left', 'width', 'height', 'position']
attributesToClear = ['title', 'top', 'right', 'bottom', 'left', 'width', 'height', 'position', 'nextFunction', 'prevFunction']
scope.stepCount = scope.steps.length

# Button Actions
scope.next = -> scope.index = scope.index + 1
scope.previous = -> scope.index = scope.index - 1
scope.next = ->
if scope.steps[scope.index].nextFunction
scope.steps[scope.index].nextFunction();
scope.index = scope.index + 1
scope.previous = ->
if scope.steps[scope.index].prevFunction
scope.steps[scope.index].prevFunction();
scope.index = scope.index - 1
scope.close = ->
scope.enabled = false
setupOverlay(false)
Expand Down