Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature skip all button implemented #76

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ $.fn.pagewalkthrough.defaults = {
// function which returns a boolean value
show: true
},
jpwSkipAll: {
i18n: 'Skip All ⏩',
// Whether or not to show the button. Can be a boolean value, or a
// function which returns a boolean value
show: function() {
return isFirstStep();
}
},
jpwNext: {
i18n: 'Next →',
// Function which resolves to a boolean
Expand Down
2 changes: 1 addition & 1 deletion src/css/jquery.pagewalkthrough.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
font-weight: lighter;
}

#jpwClose, #jpwNext, #jpwPrevious, #jpwFinish {
#jpwClose, #jpwSkipAll, #jpwNext, #jpwPrevious, #jpwFinish {
.control();
}

Expand Down
11 changes: 11 additions & 0 deletions src/jquery.pagewalkthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
}
}

showButton('jpwSkipAll');
showButton('jpwPrevious');
showButton('jpwNext');
showButton('jpwFinish');
Expand Down Expand Up @@ -889,6 +890,10 @@
/* Close and finish tour buttons clicks */
$(document).on('click', '#jpwClose, #jpwFinish', methods.close);

/* Skip All to skip all tour steps
*/
$(document).on('click', '#jpwSkipAll', methods.close);

/* Next button clicks
*/
$(document).on('click', '#jpwNext', function() {
Expand Down Expand Up @@ -1038,6 +1043,12 @@
// function which returns a boolean value
show: true
},
jpwSkipAll: {
i18n: 'Skip All ⏩',
show: function() {
return isFirstStep();
}
},
jpwNext: {
i18n: 'Next →',
// Function which resolves to a boolean
Expand Down