mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-27 16:25:15 +02:00
Tried to fix the counting for zero,
but the real problem relies in that the device counting takes time and we don't know before-hand how many devices we have. Also the scope is not shared between the device list and the remote control.
This commit is contained in:
@@ -13,7 +13,7 @@ module.exports = function counterDirective($timeout, $$rAF) {
|
||||
step = 0
|
||||
scope.timoutId = null
|
||||
countTo = parseInt(attrs.countTo) || 0
|
||||
scope.value = parseInt(attrs.value, 10) || 0
|
||||
scope.value = parseInt(attrs.countFrom, 10) || 0
|
||||
duration = parseFloat(attrs.duration) || 0
|
||||
|
||||
steps = Math.ceil(duration / refreshInterval)
|
||||
@@ -52,7 +52,7 @@ module.exports = function counterDirective($timeout, $$rAF) {
|
||||
}
|
||||
})
|
||||
|
||||
attrs.$observe('value', function (val) {
|
||||
attrs.$observe('countFrom', function (val) {
|
||||
start()
|
||||
})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = angular.module('stf.counter', [
|
||||
|
||||
])
|
||||
.directive('counter', require('./counter-directive'))
|
||||
.directive('countFrom', require('./counter-directive'))
|
||||
|
||||
Reference in New Issue
Block a user