Skip to content

Commit

Permalink
small CR fixes for wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
smartapant committed Jan 6, 2016
1 parent 03288fe commit bfd1084
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/app/pages/form/wizard/wizard.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<div class="wizard">
<div class="row">
<div class="wizard-navigation-container">
<div ng-repeat="t in $baWizardController.tabs" class="wizard-navigation {{$baWizardController.tabNum == $index ? 'active' : ''}}" ng-click="$baWizardController.selectTab($index)">
{{t.title}}
</div>
<div class="wizard-navigation-container">
<div ng-repeat="t in $baWizardController.tabs" class="wizard-navigation {{$baWizardController.tabNum == $index ? 'active' : ''}}" ng-click="$baWizardController.selectTab($index)">
{{t.title}}
</div>
</div>


<div class="progress progress-wizard">
<div class="progress-bar progress-bar-info active" role="progressbar"
aria-valuemin="0" aria-valuemax="100" style="{{'width: ' + $baWizardController.progress + '%;'}}">
aria-valuemin="0" aria-valuemax="100" ng-style="{width: $baWizardController.progress + '%'}">
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/form/wizard/wizardPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<select class="form-control" title="Category" selectpicker>
<option selected>Electronics</option>
<option>Toys</option>
<option>Weed</option>
<option>Accessories</option>
</select>
</div>
</div>
Expand Down Expand Up @@ -95,7 +95,7 @@
</ba-wizard-tab>
<ba-wizard-tab title="Finish">
<form class="form-horizontal" name="vm.finishForm" novalidate>
Congratulations! You have successfully filled the form
Congratulations! You have successfully filled the form!
</form>
</ba-wizard-tab>
</ba-wizard>
Expand Down
8 changes: 4 additions & 4 deletions src/app/pages/form/wizard/wizrdCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
transclude: true,
templateUrl: 'app/pages/form/wizard/wizard.html',
controllerAs: '$baWizardController',
controller: ['$scope', function ($scope) {
controller: function ($scope) {
var vm = this;
vm.tabs = [];

Expand All @@ -42,7 +42,7 @@
vm.selectTab(0);
};

$scope.$watch(angular.bind(vm, function () {return vm.tabNum;}), countProgress);
$scope.$watch(angular.bind(vm, function () {return vm.tabNum;}), calcProgress);

vm.selectTab = function (tabNum) {
vm.tabs[vm.tabNum].submit();
Expand Down Expand Up @@ -70,10 +70,10 @@
vm.selectTab(vm.tabNum - 1)
};

function countProgress() {
function calcProgress() {
vm.progress = ((vm.tabNum + 1) / vm.tabs.length) * 100;
}
}]
}
}
}

Expand Down

0 comments on commit bfd1084

Please sign in to comment.