Open crosborn opened 7 years ago
The stopwatch needs a rewrite to do this. It'll have to wait until after Roses so we have enough time to test
I implemented this for our Futsal fork using the following:
public/js/dashboard.js
socket.on("clock:tick", function (msg) {
$scope.clock = msg;
if (msg == '00:00') {
$scope.[sport].clockPause = true;
}
});
$scope.pauseClock = function() {
socket.emit("clock:pause");
$scope.[sport].clockPause = !$scope.[sport].clockPause;
};
public/admin/templates/[sport].tmpl.html
<div class="ui icon blue button" ng-click="pauseClock()">
<i class="play icon" ng-show="![sport].clockpause"></i>
<i class="pause icon" ng-show="[sport].clockpause"></i>
</div>
Crude, but works.
Fix: pause button needs to change between pause/play symbols depending on whether the timer is running