Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(timepicker's)timepicker's show-spinners are not being dynamically updated (closes #6604) #6606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/timepicker/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ angular.module('ui.bootstrap.timepicker', [])
}
}));
}
if ($attrs.showSpinners) {
watchers.push($scope.$parent.$watch($parse($attrs.showSpinners), function (value) {
$scope.showSpinners = !!value;
refresh();
}));
}

// Get $scope.hours in 24H mode if valid
function getHoursFromTemplate() {
Expand Down
4 changes: 2 additions & 2 deletions template/timepicker/timepicker.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<table class="uib-timepicker">
<tbody>
<tr class="text-center" ng-show="::showSpinners">
<tr class="text-center" ng-show="showSpinners">
<td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
<td>&nbsp;</td>
<td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
Expand All @@ -22,7 +22,7 @@
</td>
<td ng-show="showMeridian" class="uib-time am-pm"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>
</tr>
<tr class="text-center" ng-show="::showSpinners">
<tr class="text-center" ng-show="showSpinners">
<td class="uib-decrement hours"><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>
<td>&nbsp;</td>
<td class="uib-decrement minutes"><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>
Expand Down