Skip to content
Merged
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
55 changes: 28 additions & 27 deletions src/wizard/wizard-buttons.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
function wizardButtonDirective (action) {
(function () {
'use strict';

angular.module('patternfly.wizard')
.directive(action, function () {
return {
restrict: 'A',
require: '^pf-wizard',
scope: {
callback: "=?"
},
link: function ($scope, $element, $attrs, wizard) {
$element.on("click", function (e) {
e.preventDefault();
$scope.$apply(function () {
// scope apply in button module
$scope.$eval($attrs[action]);
wizard[action.replace("pfWiz", "").toLowerCase()]($scope.callback);
function pfWizardButtonDirective (action) {
angular.module('patternfly.wizard')
.directive(action, function () {
return {
restrict: 'A',
require: '^pf-wizard',
scope: {
callback: "=?"
},
link: function ($scope, $element, $attrs, wizard) {
$element.on("click", function (e) {
e.preventDefault();
$scope.$apply(function () {
// scope apply in button module
$scope.$eval($attrs[action]);
wizard[action.replace("pfWiz", "").toLowerCase()]($scope.callback);
});
});
});
}
};
});
}
}
};
});
}

wizardButtonDirective('pfWizNext');
wizardButtonDirective('pfWizPrevious');
wizardButtonDirective('pfWizFinish');
wizardButtonDirective('pfWizCancel');
wizardButtonDirective('pfWizReset');
pfWizardButtonDirective('pfWizNext');
pfWizardButtonDirective('pfWizPrevious');
pfWizardButtonDirective('pfWizFinish');
pfWizardButtonDirective('pfWizCancel');
pfWizardButtonDirective('pfWizReset');
})();
Copy link
Member

Choose a reason for hiding this comment

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

I would still like to see these function prefixed with pf. For example, pfWizardButtonDirective('pfWizNext')