From b28028ac4082842143b0f528d6bc539da6ccb419 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 21 Sep 2017 12:49:18 -0400 Subject: mega changes, including updates and X --- 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