Skip to content

Commit 7f4b0dd

Browse files
committed
v1.2.0
1 parent e2581fc commit 7f4b0dd

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

dist/angular-timer.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* angular-timer - v1.1.9 - 2014-11-23 7:22 PM
2+
* angular-timer - v1.2.0 - 2014-12-15 6:34 PM
33
* https://github.com/siddii/angular-timer
44
*
55
* Copyright (c) 2014 Siddique Hameed
@@ -61,7 +61,11 @@ var timerModule = angular.module('timer', [])
6161
$scope.$on('timer-clear', function () {
6262
$scope.clear();
6363
});
64-
64+
65+
$scope.$on('timer-reset', function () {
66+
$scope.reset();
67+
});
68+
6569
$scope.$on('timer-set-countdown', function (e, countdown) {
6670
$scope.countdown = countdown;
6771
});
@@ -107,6 +111,16 @@ var timerModule = angular.module('timer', [])
107111
$scope.isRunning = false;
108112
};
109113

114+
$scope.reset = $element[0].reset = function () {
115+
$scope.startTime = $scope.startTimeAttr ? new Date($scope.startTimeAttr) : new Date();
116+
$scope.endTime = $scope.endTimeAttr ? new Date($scope.endTimeAttr) : null;
117+
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
118+
resetTimeout();
119+
tick();
120+
$scope.isRunning = false;
121+
$scope.clear();
122+
};
123+
110124
$element.bind('$destroy', function () {
111125
resetTimeout();
112126
$scope.isRunning = false;

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Siddique Hameed",
33
"name": "angular-timer",
4-
"version": "1.1.9",
4+
"version": "1.2.0",
55
"homepage": "https://github.com/siddii/angular-timer",
66
"main":"dist/angular-timer.js",
77
"licenses": {

0 commit comments

Comments
 (0)