11/**
2- * angular-timer - v1.3.4 - 2016-05-01 9:52 PM
2+ * angular-timer - v1.3.5 - 2017-02-14 1:19 PM
33 * https://github.com/siddii/angular-timer
44 *
5- * Copyright (c) 2016 Siddique Hameed
5+ * Copyright (c) 2017 Adrian Wardell
66 * Licensed MIT <https://github.com/siddii/angular-timer/blob/master/LICENSE.txt>
77 */
8- var humanizeDuration = require ( "humanize-duration" ) ;
9- var moment = require ( "moment" ) ;
108var timerModule = angular . module ( 'timer' , [ ] )
119 . directive ( 'timer' , [ '$compile' , function ( $compile ) {
1210 return {
@@ -123,7 +121,7 @@ var timerModule = angular.module('timer', [])
123121 }
124122 } ) ;
125123
126- $scope . start = $element [ 0 ] . start = function ( ) {
124+ $scope . start = function ( ) {
127125 $scope . startTime = $scope . startTimeAttr ? moment ( $scope . startTimeAttr ) : moment ( ) ;
128126 $scope . endTime = $scope . endTimeAttr ? moment ( $scope . endTimeAttr ) : null ;
129127 if ( ! angular . isNumber ( $scope . countdown ) ) {
@@ -134,7 +132,7 @@ var timerModule = angular.module('timer', [])
134132 $scope . isRunning = true ;
135133 } ;
136134
137- $scope . resume = $element [ 0 ] . resume = function ( ) {
135+ $scope . resume = function ( ) {
138136 resetTimeout ( ) ;
139137 if ( $scope . countdownattr ) {
140138 $scope . countdown += 1 ;
@@ -144,21 +142,21 @@ var timerModule = angular.module('timer', [])
144142 $scope . isRunning = true ;
145143 } ;
146144
147- $scope . stop = $scope . pause = $element [ 0 ] . stop = $element [ 0 ] . pause = function ( ) {
145+ $scope . stop = $scope . pause = function ( ) {
148146 var timeoutId = $scope . timeoutId ;
149147 $scope . clear ( ) ;
150148 $scope . $emit ( 'timer-stopped' , { timeoutId : timeoutId , millis : $scope . millis , seconds : $scope . seconds , minutes : $scope . minutes , hours : $scope . hours , days : $scope . days } ) ;
151149 } ;
152150
153- $scope . clear = $element [ 0 ] . clear = function ( ) {
151+ $scope . clear = function ( ) {
154152 // same as stop but without the event being triggered
155153 $scope . stoppedTime = moment ( ) ;
156154 resetTimeout ( ) ;
157155 $scope . timeoutId = null ;
158156 $scope . isRunning = false ;
159157 } ;
160158
161- $scope . reset = $element [ 0 ] . reset = function ( ) {
159+ $scope . reset = function ( ) {
162160 $scope . startTime = $scope . startTimeAttr ? moment ( $scope . startTimeAttr ) : moment ( ) ;
163161 $scope . endTime = $scope . endTimeAttr ? moment ( $scope . endTimeAttr ) : null ;
164162 $scope . countdown = angular . isNumber ( $scope . countdownattr ) && parseInt ( $scope . countdownattr , 10 ) > 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
@@ -258,7 +256,7 @@ var timerModule = angular.module('timer', [])
258256 if ( $scope . countdownattr ) {
259257 $scope . millis = $scope . countdownattr * 1000 ;
260258
261- $scope . addCDSeconds = $element [ 0 ] . addCDSeconds = function ( extraSeconds ) {
259+ $scope . addCDSeconds = function ( extraSeconds ) {
262260 $scope . countdown += extraSeconds ;
263261 $scope . $digest ( ) ;
264262 if ( ! $scope . isRunning ) {
@@ -319,7 +317,7 @@ var timerModule = angular.module('timer', [])
319317 $scope . $digest ( ) ;
320318 } , $scope . interval - adjustment ) ;
321319
322- $scope . $emit ( 'timer-tick' , { timeoutId : $scope . timeoutId , millis : $scope . millis , timerElement : $element [ 0 ] } ) ;
320+ $scope . $emit ( 'timer-tick' , { timeoutId : $scope . timeoutId , millis : $scope . millis } ) ;
323321
324322 if ( $scope . countdown > 0 ) {
325323 $scope . countdown -- ;
0 commit comments