mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-30 11:10:04 +00:00
feat(focusMode): better edge case handling
This commit is contained in:
parent
150fed1c14
commit
669fcf0e50
3 changed files with 64 additions and 41 deletions
|
|
@ -31,6 +31,11 @@
|
|||
input {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&.is-done{
|
||||
text-decoration: line-through;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
}
|
||||
|
||||
md-progress-linear {
|
||||
|
|
|
|||
|
|
@ -28,53 +28,66 @@
|
|||
<div class="task"
|
||||
ng-class="{'is-current':vm.pomodoroData.status==='PLAY'}">
|
||||
<h2 edit-on-click="vm.task.title"
|
||||
ng-class="{'is-done':vm.task.isDone}"
|
||||
class="title"></h2>
|
||||
<md-progress-linear md-mode="determinate"
|
||||
value="{{vm.task.progress}}"></md-progress-linear>
|
||||
<div class="time"
|
||||
ng-bind="(vm.task.timeSpent|duration) +' / ' + (vm.task.timeEstimate|duration)"></div>
|
||||
|
||||
<div class="controls">
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
aria-label="play/pause"
|
||||
tabindex="2"
|
||||
ng-class="{'md-accent':vm.pomodoroData.status==='PLAY'}"
|
||||
ng-click="vm.togglePlay()">
|
||||
<ng-md-icon icon="play_arrow"
|
||||
ng-if="!vm.pomodoroData.isOnBreak && vm.pomodoroData.status==='PLAY'"></ng-md-icon>
|
||||
<ng-md-icon icon="pause"
|
||||
ng-if="vm.pomodoroData.status==='MANUAL_PAUSE'"></ng-md-icon>
|
||||
<ng-md-icon icon="free_breakfast"
|
||||
ng-if="vm.pomodoroData.isOnBreak && vm.pomodoroData.status!=='MANUAL_PAUSE'"></ng-md-icon>
|
||||
|
||||
<md-tooltip md-direction="top">Start/Pause working</md-tooltip>
|
||||
</md-button>
|
||||
<!--<md-button class="md-fab md-raised md-primary"-->
|
||||
<!--tabindex="2"-->
|
||||
<!--aria-label="time estimation"-->
|
||||
<!--ng-click="vm.estimateTime(task)">-->
|
||||
<!--<ng-md-icon icon="access_time"-->
|
||||
<!--aria-label="time estimation"></ng-md-icon>-->
|
||||
<!--</md-button>-->
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
aria-label="link"
|
||||
tabindex="2"
|
||||
target="_blank"
|
||||
ng-if="::vm.task.originalLink"
|
||||
external-link
|
||||
ng-href="{{ ::vm.task.originalLink }}">
|
||||
<ng-md-icon icon="{{vm.task.originalType ==='GITHUB' ? 'github-circle':'link'}}"
|
||||
aria-label="link"></ng-md-icon>
|
||||
<md-tooltip md-direction="top">Go to issue page</md-tooltip>
|
||||
</md-button>
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
tabindex="2"
|
||||
aria-label="Mark as done and start next task"
|
||||
ng-click="vm.markAsDone()">
|
||||
<ng-md-icon icon="check"
|
||||
aria-label="Mark as done and start next task"></ng-md-icon>
|
||||
<md-tooltip md-direction="top">Mark as done and start next task</md-tooltip>
|
||||
</md-button>
|
||||
<div class="controls">
|
||||
<div ng-if="vm.task.isDone">
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
tabindex="2"
|
||||
aria-label="close"
|
||||
ng-click="vm.cancel()">
|
||||
<ng-md-icon icon="close"
|
||||
aria-label="close"></ng-md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
<div ng-if="!vm.task.isDone">
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
aria-label="play/pause"
|
||||
tabindex="2"
|
||||
ng-class="{'md-accent':vm.pomodoroData.status==='PLAY'}"
|
||||
ng-click="vm.togglePlay()">
|
||||
<ng-md-icon icon="play_arrow"
|
||||
ng-if="!vm.pomodoroData.isOnBreak && vm.pomodoroData.status==='PLAY'"></ng-md-icon>
|
||||
<ng-md-icon icon="pause"
|
||||
ng-if="vm.pomodoroData.status==='MANUAL_PAUSE'"></ng-md-icon>
|
||||
<ng-md-icon icon="free_breakfast"
|
||||
ng-if="vm.pomodoroData.isOnBreak && vm.pomodoroData.status!=='MANUAL_PAUSE'"></ng-md-icon>
|
||||
|
||||
<md-tooltip md-direction="top">Start/Pause working</md-tooltip>
|
||||
</md-button>
|
||||
<!--<md-button class="md-fab md-raised md-primary"-->
|
||||
<!--tabindex="2"-->
|
||||
<!--aria-label="time estimation"-->
|
||||
<!--ng-click="vm.estimateTime(task)">-->
|
||||
<!--<ng-md-icon icon="access_time"-->
|
||||
<!--aria-label="time estimation"></ng-md-icon>-->
|
||||
<!--</md-button>-->
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
aria-label="link"
|
||||
tabindex="2"
|
||||
target="_blank"
|
||||
ng-if="::vm.task.originalLink"
|
||||
external-link
|
||||
ng-href="{{ ::vm.task.originalLink }}">
|
||||
<ng-md-icon icon="{{vm.task.originalType ==='GITHUB' ? 'github-circle':'link'}}"
|
||||
aria-label="link"></ng-md-icon>
|
||||
<md-tooltip md-direction="top">Go to issue page</md-tooltip>
|
||||
</md-button>
|
||||
<md-button class="md-fab md-raised md-primary"
|
||||
tabindex="2"
|
||||
aria-label="Mark as done and start next task"
|
||||
ng-click="vm.markAsDone()">
|
||||
<ng-md-icon icon="check"
|
||||
aria-label="Mark as done and start next task"></ng-md-icon>
|
||||
<md-tooltip md-direction="top">Mark as done and start next task</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
.controller('PomodoroFocusCtrl', PomodoroFocusCtrl);
|
||||
|
||||
/* @ngInject */
|
||||
function PomodoroFocusCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton, Notifier, Tasks) {
|
||||
function PomodoroFocusCtrl($mdDialog, $rootScope, theme, pomodoroData, pomodoroConfig, $scope, $timeout, IS_ELECTRON, PomodoroButton, Notifier, Tasks, SimpleToast) {
|
||||
this.r = $rootScope.r;
|
||||
this.theme = theme;
|
||||
this.pomodoroData = pomodoroData;
|
||||
|
|
@ -27,6 +27,11 @@
|
|||
|
||||
this.markAsDone = () => {
|
||||
Tasks.markAsDone(this.task);
|
||||
this.task = Tasks.getCurrent() || Tasks.getLastCurrent();
|
||||
if (this.task.isDone) {
|
||||
SimpleToast('SUCCESS', 'All tasks done for today, create some new if you have to!')
|
||||
$mdDialog.hide();
|
||||
}
|
||||
};
|
||||
|
||||
this.cancel = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue