LA1TV / Roses-CasparCG-Graphics

Location of CG assets for use during the Roses event
6 stars 8 forks source link

Fix: Basketball/football/swimming/boxing pause button #13

Open crosborn opened 7 years ago

crosborn commented 7 years ago

Fix: pause button needs to change between pause/play symbols depending on whether the timer is running

joshhodgson commented 7 years ago

no

The stopwatch needs a rewrite to do this. It'll have to wait until after Roses so we have enough time to test

peskdale commented 7 years ago

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.