Skip to content

Commit

Permalink
Adds a classStatus variable to the scope
Browse files Browse the repository at this point in the history
Should help inject classes for our timer.
  • Loading branch information
camilopayan committed Jul 26, 2015
1 parent 3661d71 commit 17e3e70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/timer/timerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ app.controller('TimerController', ['PomTimer',
var tc = this;
tc.timeLeft = 0;
tc.phase = "POMODORO";
tc.classStatus = null;
tc.poms = 0;

function tickCallback(){
Expand All @@ -14,11 +15,17 @@ app.controller('TimerController', ['PomTimer',

PomTimer.registerPhaseCallback(function(){
tc.phase = PomTimer.getPhase();
if(tc.phase === "LONGBREAK" || tc.phase === "SHORTBREAK"){
tc.classStatus = "running break";
} else {
tc.classStatus = "";
}
tc.poms = PomTimer.getPomCount();
});

tc.start = function(){
PomTimer.startTimer();
tc.classStatus = "running pom";
};

tc.cancel = function(){
Expand Down

0 comments on commit 17e3e70

Please sign in to comment.