Skip to content

Commit

Permalink
added ability to show/hide next/previous buttons on a tour as well as…
Browse files Browse the repository at this point in the history
… a step level

set scroll behavior to auto to not show the scrollbar if it's not needed
  • Loading branch information
bmartinelle committed Jan 27, 2016
1 parent 5686131 commit e1e1de4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/nz-tour.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nz-tour #nzTour-box-wrap {
nz-tour #nzTour-box {
width: 250px;
min-height: 69px;
max-height: 120px;
max-height: 500px;
padding: 0.5em;
background: #fff;
-webkit-box-shadow: 0 6px 19px 2px rgba(0,0,0,0.14);
Expand Down Expand Up @@ -182,7 +182,7 @@ nz-tour #nzTour-content {
height: 100%;
max-height: 104px;
overflow-x: hidden;
overflow-y: scroll;
overflow-y: auto;
position: relative;
border-bottom: solid 32px transparent;
-webkit-box-shadow: inset 0 -20px 20px -20px rgba(0,0,0,0.2);
Expand Down
20 changes: 13 additions & 7 deletions dist/nz-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
finishText: 'Finish',
animationDuration: 400,
placementPriority: ['bottom', 'right', 'top', 'left'],
disableHotkeys: false
disableHotkeys: false,
showPrevious: true,
showNext: true
},
current: false,
body: angular.element('body'),
Expand Down Expand Up @@ -263,8 +265,8 @@
' <div id="nzTour-inner-content"></div>',
' </div>',
' <div id="nzTour-actions">',
' <button id="nzTour-previous" ng-show="view.step > 0" ng-click="previous()">{{view.previousText}}</button>',
' <button id="nzTour-next" ng-show="view.step >= 0" ng-click="next()" class="success">{{view.nextText}}</button>',
' <button id="nzTour-previous" ng-show="view.step > 0 && view.showPrevious" ng-click="previous()"> ng-click="previous()">{{view.previousText}}</button>',
' <button id="nzTour-next" ng-show="view.step >= 0 && view.showNext" ng-click="next()" class="success">{{view.nextText}}</button>',
' </div>',
' </div>',
'</div>',
Expand Down Expand Up @@ -391,9 +393,11 @@
prevent(e);
return;
case 27:
$scope.stop();
prevent(e);
return;
if (!config.disableEscExit) {
$scope.stop();
prevent(e);
return;
}
case 38:
case 40:
onWindowScrollDebounced();
Expand Down Expand Up @@ -482,7 +486,9 @@
step: step,
length: steps.length,
previousText: config.previousText,
nextText: step == steps.length - 1 ? config.finishText : config.nextText
nextText: step == steps.length - 1 ? config.finishText : config.nextText,
showNext: steps[step].showNext === undefined ? config.showNext : steps[step].showNext,
showPrevious: steps[step].showPrevious === undefined ? config.showPrevious : steps[step].showPrevious
};
//Don't mess around with angular sanitize for now. Add compile and sanitize later...
els.innerContent.html(steps[step].content);
Expand Down
2 changes: 1 addition & 1 deletion dist/nz-tour.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1e1de4

Please sign in to comment.