From c59f45bf14e7915feca4e0303e204e33ef83998e Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Sat, 30 Apr 2016 14:44:13 -0400 Subject: #234 - initial code - template Former-commit-id: 57b199dac407d8a19ca13df5f54ca829d40bb7e6 --- www/lib/angular-wizard/src/wizardButtons.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 www/lib/angular-wizard/src/wizardButtons.js (limited to 'www/lib/angular-wizard/src/wizardButtons.js') diff --git a/www/lib/angular-wizard/src/wizardButtons.js b/www/lib/angular-wizard/src/wizardButtons.js new file mode 100644 index 00000000..0afb46f8 --- /dev/null +++ b/www/lib/angular-wizard/src/wizardButtons.js @@ -0,0 +1,26 @@ +function wizardButtonDirective(action) { + angular.module('mgo-angular-wizard') + .directive(action, function() { + return { + restrict: 'A', + replace: false, + require: '^wizard', + link: function($scope, $element, $attrs, wizard) { + + $element.on("click", function(e) { + e.preventDefault(); + $scope.$apply(function() { + $scope.$eval($attrs[action]); + wizard[action.replace("wz", "").toLowerCase()](); + }); + }); + } + }; + }); +} + +wizardButtonDirective('wzNext'); +wizardButtonDirective('wzPrevious'); +wizardButtonDirective('wzFinish'); +wizardButtonDirective('wzCancel'); +wizardButtonDirective('wzReset'); -- cgit v1.2.3