Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siddii committed Dec 16, 2014
1 parent e2581fc commit 7f4b0dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
18 changes: 16 additions & 2 deletions dist/angular-timer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* angular-timer - v1.1.9 - 2014-11-23 7:22 PM
* angular-timer - v1.2.0 - 2014-12-15 6:34 PM
* https://github.com/siddii/angular-timer
*
* Copyright (c) 2014 Siddique Hameed
Expand Down Expand Up @@ -61,7 +61,11 @@ var timerModule = angular.module('timer', [])
$scope.$on('timer-clear', function () {
$scope.clear();
});


$scope.$on('timer-reset', function () {
$scope.reset();
});

$scope.$on('timer-set-countdown', function (e, countdown) {
$scope.countdown = countdown;
});
Expand Down Expand Up @@ -107,6 +111,16 @@ var timerModule = angular.module('timer', [])
$scope.isRunning = false;
};

$scope.reset = $element[0].reset = function () {
$scope.startTime = $scope.startTimeAttr ? new Date($scope.startTimeAttr) : new Date();
$scope.endTime = $scope.endTimeAttr ? new Date($scope.endTimeAttr) : null;
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
resetTimeout();
tick();
$scope.isRunning = false;
$scope.clear();
};

$element.bind('$destroy', function () {
resetTimeout();
$scope.isRunning = false;
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-timer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Siddique Hameed",
"name": "angular-timer",
"version": "1.1.9",
"version": "1.2.0",
"homepage": "https://github.com/siddii/angular-timer",
"main":"dist/angular-timer.js",
"licenses": {
Expand Down

0 comments on commit 7f4b0dd

Please sign in to comment.