Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/wizard/wizard.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ angular.module('patternfly.wizard').component('pfWizard', {
// Save the step you were on when next() was invoked
var index = stepIdx(ctrl.selectedStep);

callback = callback || ctrl.nextCallback;

if (ctrl.selectedStep.substeps) {
if (ctrl.selectedStep.next(callback)) {
return;
Expand Down Expand Up @@ -625,6 +627,7 @@ angular.module('patternfly.wizard').component('pfWizard', {

ctrl.previous = function (callback) {
var index = stepIdx(ctrl.selectedStep);
callback = callback || ctrl.backCallback;

if (ctrl.selectedStep.substeps) {
if (ctrl.selectedStep.previous(callback)) {
Expand Down
41 changes: 25 additions & 16 deletions src/wizard/wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,34 @@ <h3 class="blank-slate-pf-main-action">{{$ctrl.loadingWizardTitle}}</h3>
<div class="wizard-pf-position-override" ng-transclude ></div>
</div>
<div class="modal-footer wizard-pf-footer wizard-pf-position-override" ng-class="{'wizard-pf-footer-inline': $ctrl.embedInPage}">
<pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel"
ng-class="{'wizard-pf-cancel-no-back': $ctrl.hideBackButton}"
ng-disabled="$ctrl.wizardDone" ng-click="$ctrl.onCancel()"
ng-if="!$ctrl.embedInPage">{{$ctrl.cancelTitle}}</pf-wiz-cancel>
<button ng-if="!$ctrl.embedInPage"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. My only question is, if there is a wizard with more than 2 panels, what happens when the "next" button is clicked? Does it reset focus on the first item in the next panel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not handle setting the focus when a page is shown. That would be left to the application. Barring the application setting the focus, the next button would still have the focus.

class="btn btn-default btn-cancel wizard-pf-cancel"
ng-class="{'wizard-pf-cancel-no-back': $ctrl.hideBackButton}"
ng-disabled="$ctrl.wizardDone"
ng-click="$ctrl.onCancel()">
{{$ctrl.cancelTitle}}
</button>
<div ng-if="!$ctrl.hideBackButton" class="tooltip-wrapper" uib-tooltip="{{$ctrl.prevTooltip}}" tooltip-placement="left">
<pf-wiz-previous id="backButton"
class="btn btn-default"
ng-disabled="!$ctrl.wizardReady || $ctrl.wizardDone || !$ctrl.selectedStep.prevEnabled || $ctrl.firstStep"
callback="$ctrl.backCallback">{{$ctrl.backTitle}}</pf-wiz-previous>
<button id="backButton"
class="btn btn-default"
ng-disabled="!$ctrl.wizardReady || $ctrl.wizardDone || !$ctrl.selectedStep.prevEnabled || $ctrl.firstStep"
ng-click="$ctrl.previous()">
{{$ctrl.backTitle}}
</button>
</div>
<div class="tooltip-wrapper" uib-tooltip="{{$ctrl.nextTooltip}}" tooltip-placement="left">
<pf-wiz-next id="nextButton"
class="btn btn-primary wizard-pf-next"
ng-disabled="!$ctrl.wizardReady || !$ctrl.selectedStep.nextEnabled"
callback="$ctrl.nextCallback">{{$ctrl.nextTitle}}</pf-wiz-next>
<button id="nextButton"
class="btn btn-primary wizard-pf-next"
ng-disabled="!$ctrl.wizardReady || !$ctrl.selectedStep.nextEnabled"
ng-click="$ctrl.next()">
{{$ctrl.nextTitle}}
</button>
</div>
<pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel wizard-pf-cancel-inline"
ng-disabled="$ctrl.wizardDone"
ng-click="$ctrl.onCancel()"
ng-if="$ctrl.embedInPage">{{$ctrl.cancelTitle}}</pf-wiz-cancel>
<button ng-if="$ctrl.embedInPage"
class="btn btn-default btn-cancel wizard-pf-cancel wizard-pf-cancel-inline"
ng-disabled="$ctrl.wizardDone"
ng-click="$ctrl.onCancel()">
{{$ctrl.cancelTitle}}
</button>
</div>
</div>