Skip to content

Commit 723fc26

Browse files
authored
Merge pull request #321 from dgutride/wizard-lefthand-buttons
Add support for embedding a wizard in a page instead of using a modal.
2 parents 4cd43fb + 926cb3f commit 723fc26

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/wizard/wizard-directive.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @param {string} loadingWizardTitle The text displayed when the wizard is loading
3434
* @param {string=} loadingSecondaryInformation Secondary descriptive information to display when the wizard is loading
3535
* @param {string=} contentHeight The height the wizard content should be set to. This defaults to 300px if the property is not supplied.
36+
* @param {boolean=} embedInPage Value that indicates wizard is embedded in a page (not a modal). This moves the navigation buttons to the left hand side of the footer and removes the close button.
3637
*
3738
* @example
3839
<example module="patternfly.wizard" deps="patternfly.form">
@@ -316,7 +317,8 @@ angular.module('patternfly.wizard').directive('pfWizard', function ($window) {
316317
wizardDone: '=?',
317318
loadingWizardTitle: '=?',
318319
loadingSecondaryInformation: '=?',
319-
contentHeight: '=?'
320+
contentHeight: '=?',
321+
embedInPage: '=?'
320322
},
321323
templateUrl: 'wizard/wizard.html',
322324
controller: function ($scope, $timeout) {

src/wizard/wizard.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div>
22
<div class="modal-header">
3-
<button type="button" class="close wizard-pf-dismiss" aria-label="Close" ng-click="onCancel()" >
3+
<button type="button" class="close wizard-pf-dismiss" aria-label="Close" ng-click="onCancel()" ng-if="!embedInPage">
44
<span aria-hidden="true">&times;</span>
55
</button>
66
<dt class="modal-title">{{title}}</dt>
77
</div>
88
<div class="modal-body wizard-pf-body clearfix">
99
<!-- step area -->
10-
<div class="wizard-pf-steps" ng-class="{'invisible': !wizardReady}"> <!-- todo - replace hidden with angular boolean -->
10+
<div class="wizard-pf-steps" ng-class="{'invisible': !wizardReady}">
1111
<ul class="wizard-pf-steps-indicator" ng-if="!hideIndicators" ng-class="{'invisible': !wizardReady}">
1212
<li class="wizard-pf-step" ng-class="{active: step.selected}" ng-repeat="step in getEnabledSteps()" data-tabgroup="{{$index }}">
1313
<a ng-click="stepClick(step)"><span class="wizard-pf-step-number">{{$index + 1}}</span><span class="wizard-pf-step-title">{{step.title}}</span></a>
@@ -25,8 +25,8 @@ <h3 class="blank-slate-pf-main-action">{{loadingWizardTitle}}</h3>
2525
</div>
2626
<div class="wizard-pf-position-override" ng-transclude ></div>
2727
</div>
28-
<div class="modal-footer wizard-pf-footer wizard-pf-position-override">
29-
<button pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel" ng-disabled="wizardDone" ng-click="onCancel()">{{cancelTitle}}</button>
28+
<div class="modal-footer wizard-pf-footer wizard-pf-position-override" ng-class="{'wizard-pf-footer-inline': embedInPage}">
29+
<button pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel" ng-disabled="wizardDone" ng-click="onCancel()" ng-if="!embedInPage">{{cancelTitle}}</button>
3030
<div class="tooltip-wrapper" tooltip="{{prevTooltip}}" tooltip-placement="left">
3131
<button id="backButton" pf-wiz-previous class="btn btn-default" ng-disabled="!wizardReady || wizardDone || !prevEnabled || firstStep"
3232
callback="backCallback">
@@ -41,5 +41,6 @@ <h3 class="blank-slate-pf-main-action">{{loadingWizardTitle}}</h3>
4141
<span class="i fa fa-angular-right"></span>
4242
</button>
4343
</div>
44+
<button pf-wiz-cancel class="btn btn-default btn-cancel wizard-pf-cancel wizard-pf-cancel-inline" ng-disabled="wizardDone" ng-click="onCancel()" ng-if="embedInPage">{{cancelTitle}}</button>
4445
</div>
4546
</div>

styles/angular-patternfly.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,3 +447,11 @@ accordion > .panel-group .panel-open .panel-title > a:before {
447447
.wizard-pf-position-override {
448448
position: relative;
449449
}
450+
451+
.wizard-pf-footer-inline {
452+
text-align: left;
453+
}
454+
455+
.wizard-pf-cancel-inline {
456+
margin-left: 25px;
457+
}

0 commit comments

Comments
 (0)