Skip to content

Commit 2e94082

Browse files
committed
Merge pull request siddii#227 from oc-digital/master
Adds timerElement to returned arguments object of ‘timer-tick’
2 parents 6b51c52 + 620d566 commit 2e94082

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

app/js/_timer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ var timerModule = angular.module('timer', [])
1818
hours: '=?',
1919
days: '=?',
2020
months: '=?',
21-
years: '=?',
21+
years: '=?',
2222
secondsS: '=?',
2323
minutesS: '=?',
2424
hoursS: '=?',
2525
daysS: '=?',
2626
monthsS: '=?',
27-
yearsS: '=?'
27+
yearsS: '=?'
2828
},
2929
controller: ['$scope', '$element', '$attrs', '$timeout', 'I18nService', '$interpolate', 'progressBarService', function ($scope, $element, $attrs, $timeout, I18nService, $interpolate, progressBarService) {
3030

@@ -310,7 +310,7 @@ var timerModule = angular.module('timer', [])
310310
$scope.$digest();
311311
}, $scope.interval - adjustment);
312312

313-
$scope.$emit('timer-tick', {timeoutId: $scope.timeoutId, millis: $scope.millis});
313+
$scope.$emit('timer-tick', {timeoutId: $scope.timeoutId, millis: $scope.millis, timerElement: $element[0]});
314314

315315
if ($scope.countdown > 0) {
316316
$scope.countdown--;

dist/angular-timer.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* angular-timer - v1.3.3 - 2015-08-17 4:25 PM
2+
* angular-timer - v1.3.3 - 2015-11-30 10:57 AM
33
* https://github.com/siddii/angular-timer
44
*
55
* Copyright (c) 2015 Siddique Hameed
@@ -19,19 +19,19 @@ var timerModule = angular.module('timer', [])
1919
autoStart: '&autoStart',
2020
language: '@?',
2121
fallback: '@?',
22-
maxTimeUnit: '=?',
22+
maxTimeUnit: '=',
2323
seconds: '=?',
2424
minutes: '=?',
2525
hours: '=?',
2626
days: '=?',
2727
months: '=?',
28-
years: '=?',
28+
years: '=?',
2929
secondsS: '=?',
3030
minutesS: '=?',
3131
hoursS: '=?',
3232
daysS: '=?',
3333
monthsS: '=?',
34-
yearsS: '=?'
34+
yearsS: '=?'
3535
},
3636
controller: ['$scope', '$element', '$attrs', '$timeout', 'I18nService', '$interpolate', 'progressBarService', function ($scope, $element, $attrs, $timeout, I18nService, $interpolate, progressBarService) {
3737

@@ -76,7 +76,7 @@ var timerModule = angular.module('timer', [])
7676
$scope.startTime = null;
7777
$scope.endTime = null;
7878
$scope.timeoutId = null;
79-
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) >= 0 ? parseInt($scope.countdownattr, 10) : undefined;
79+
$scope.countdown = angular.isNumber($scope.countdownattr) && parseInt($scope.countdownattr, 10) >= 0 ? parseInt($scope.countdownattr, 10) : undefined;
8080
$scope.isRunning = false;
8181

8282
$scope.$on('timer-start', function () {
@@ -124,8 +124,8 @@ var timerModule = angular.module('timer', [])
124124
$scope.start = $element[0].start = function () {
125125
$scope.startTime = $scope.startTimeAttr ? moment($scope.startTimeAttr) : moment();
126126
$scope.endTime = $scope.endTimeAttr ? moment($scope.endTimeAttr) : null;
127-
if (!$scope.countdown) {
128-
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
127+
if (!angular.isNumber($scope.countdown)) {
128+
$scope.countdown = angular.isNumber($scope.countdownattr) && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
129129
}
130130
resetTimeout();
131131
tick();
@@ -159,7 +159,7 @@ var timerModule = angular.module('timer', [])
159159
$scope.reset = $element[0].reset = function () {
160160
$scope.startTime = $scope.startTimeAttr ? moment($scope.startTimeAttr) : moment();
161161
$scope.endTime = $scope.endTimeAttr ? moment($scope.endTimeAttr) : null;
162-
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
162+
$scope.countdown = angular.isNumber($scope.countdownattr) && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
163163
resetTimeout();
164164
tick();
165165
$scope.isRunning = false;
@@ -317,7 +317,7 @@ var timerModule = angular.module('timer', [])
317317
$scope.$digest();
318318
}, $scope.interval - adjustment);
319319

320-
$scope.$emit('timer-tick', {timeoutId: $scope.timeoutId, millis: $scope.millis});
320+
$scope.$emit('timer-tick', {timeoutId: $scope.timeoutId, millis: $scope.millis, timerElement: $element[0]});
321321

322322
if ($scope.countdown > 0) {
323323
$scope.countdown--;

dist/angular-timer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)