Skip to content

Commit 4cd43fb

Browse files
Merge pull request #320 from dgutride/angular-wizard
PatternFly Angular wizard implementation
2 parents f5d6f3e + 8e5ea0e commit 4cd43fb

23 files changed

+1741
-3
lines changed

Gruntfile.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ module.exports = function (grunt) {
210210
cwd: 'src/',
211211
src: ['views/**/*.html'],
212212
dest: 'templates/views.js'
213+
},
214+
'patternfly.wizard': {
215+
cwd: 'src/',
216+
src: ['wizard/**/*.html'],
217+
dest: 'templates/wizard.js'
213218
}
214219
},
215220
// ng-annotate tries to make the code safe for minification automatically

bower.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"Red Hat"
66
],
77
"description": "Angular extension of the PatternFly project.",
8-
"keywords": [ "angular", "patternfly"],
8+
"keywords": [
9+
"angular",
10+
"patternfly"
11+
],
912
"license": "Apache-2.0",
1013
"ignore": [
1114
"node_modules",
@@ -39,7 +42,7 @@
3942
"angular-sanitize": "1.3.0 - 1.5.*",
4043
"angular-bootstrap": "0.13.x",
4144
"lodash": "3.x",
42-
"patternfly": "~3.11.0"
45+
"patternfly": "http://github.com/patternfly/patternfly.git#master-dist"
4346
},
4447
"devDependencies": {
4548
"angular-mocks": "1.3.0 - 1.5.*"

src/patternfly.module.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ angular.module('patternfly', [
1717
'patternfly.toolbars',
1818
'patternfly.utils',
1919
'patternfly.validation',
20-
'patternfly.views'
20+
'patternfly.views',
21+
'patternfly.wizard'
2122
]);
2223

src/wizard/wizard-buttons.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
function wizardButtonDirective (action) {
2+
'use strict';
3+
4+
angular.module('patternfly.wizard')
5+
.directive(action, function () {
6+
return {
7+
restrict: 'A',
8+
require: '^pf-wizard',
9+
scope: {
10+
callback: "=?"
11+
},
12+
link: function ($scope, $element, $attrs, wizard) {
13+
$element.on("click", function (e) {
14+
e.preventDefault();
15+
$scope.$apply(function () {
16+
// scope apply in button module
17+
$scope.$eval($attrs[action]);
18+
wizard[action.replace("pfWiz", "").toLowerCase()]($scope.callback);
19+
});
20+
});
21+
}
22+
};
23+
});
24+
}
25+
26+
wizardButtonDirective('pfWizNext');
27+
wizardButtonDirective('pfWizPrevious');
28+
wizardButtonDirective('pfWizFinish');
29+
wizardButtonDirective('pfWizCancel');
30+
wizardButtonDirective('pfWizReset');

0 commit comments

Comments
 (0)