Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. $scope.startOrStop = function() {
  2. if (isStart) {
  3. $scope.style = {background: 'red'};
  4. $scope.start();
  5. $scope.startTIME();
  6. isStart = false;
  7. $scope.buttonText = "Stop";
  8. } else {
  9. $scope.style = {
  10. background: '#11dc51'
  11. };
  12. $scope.stop();
  13. isStart = true;
  14. $scope.buttonText = "Start";
  15. }
  16. };
  17.  
  18. $scope.quickStart=function(tasks){
  19. if (isStart) {
  20. $scope.style = {
  21. background: 'red'
  22. };
  23. $scope.start();
  24. $scope.startTIME();
  25. isStart = false;
  26. $scope.buttonText = "Stop";
  27. $scope.currentTask.name=tasks.name;
  28. $scope.currentTask.selectedProject=tasks.selectedProject;
  29.  
  30. } else {
  31. $scope.style = {
  32. background: 'red'
  33. };
  34. $scope.stop();
  35. var restart = $timeout($scope.quickStart, 100);
  36. $scope.currentTask.name=tasks.name;
  37. $scope.currentTask.selectedProject=tasks.selectedProject;
  38. isStart = true;
  39. $scope.buttonText = "Stop";
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement