Commit 08f3cf3b authored by Curtis Adam's avatar Curtis Adam

Open the Pomodoro modal automatically with the sidebar button and only display...

Open the Pomodoro modal automatically with the sidebar button and only display the timer when it is active
parent 1395f6c2
......@@ -85,7 +85,8 @@
"work": " Präsentatieren: <span class=\"pomodoroHighlight\">__minutes__</span> pro Präsentation",
"break": " Pausieren: <span class=\"pomodoroHighlight\">__minutes__</span> pro Präsentation",
"button": {
"start": "Präsentation starten!"
"start": "Präsentation starten!",
"cancel": "Abbrechen"
}
}
},
......
......@@ -85,7 +85,8 @@
"work": "Work for: <span class=\"pomodoroHighlight\">__minutes__</span> each pomodoro",
"break": "Relax for: <span class=\"pomodoroHighlight\">__minutes__</span> each pomodoro",
"button": {
"start": "Let's go!"
"start": "Let's go!",
"cancel": "Cancel"
}
}
},
......
......@@ -366,7 +366,7 @@ export let PomodoroTimer = class PomodoroTimer {
let count = (goalPoms - totalPoms);
if (pomRunning || breakRunning) {
if (Route.isPresentation()) {
this.resetTimer();
this.setPresentationPomodoro(true);
} else {
/*if you still haven't reached your goal, you are encouraged with an update of how many pomodoros and minutes you have left to reach it.*/
if (totalPoms < goalPoms) {
......@@ -761,8 +761,10 @@ export let PomodoroTimer = class PomodoroTimer {
static setPresentationPomodoro (forceOff = false) {
if (Session.get('presentationPomodoroActive') || forceOff) {
Session.set('presentationPomodoroActive', false);
this.resetTimer();
} else {
Session.set('presentationPomodoroActive', true);
$('#pomodoroTimerModal').modal('show');
}
}
};
......@@ -49,7 +49,8 @@
<template name="pomodoroTimerModal">
<!--this is the modal, hidden by default, that pops up when the user clicks the clock. Not too complicated.-->
<div id="pomodoroTimerModal" class="modal fade" role="dialog">
<div id="pomodoroTimerModal" class="modal fade" role="dialog"
data-backdrop="{{#if isActiveRoute regex='presentation'}}static{{/if}}">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
......@@ -65,12 +66,16 @@
</form>
</div>
<div class="modal-footer">
{{#unless isActiveRoute regex='presentation'}}
{{#if isActiveRoute regex='presentation'}}
<button type="button" id="cancelPomodoroBtn" class="btn btn-danger btn-raised">
{{_ "pomodoro.form.presentation.button.cancel"}}
</button>
{{else}}
<button type="button" id="settingsBtn" class="btn btn-info btn-raised fa fa-gear hvr-bounce-in"
style="float:left;">
{{_ "pomodoro.form.user.button.settings"}}
</button>
{{/unless}}
{{/if}}
<button type="button" id="startPom" class="btn btn-success btn-raised" data-dismiss="modal">
{{#if isActiveRoute regex='presentation'}}
{{_ "pomodoro.form.presentation.button.start"}}
......
......@@ -80,6 +80,10 @@ Template.pomodoroTimerModal.events({
},
'click #startPom': function () {
PomodoroTimer.start();
},
'click #cancelPomodoroBtn': function () {
$('#pomodoroTimerModal').modal('hide');
PomodoroTimer.setPresentationPomodoro(true);
}
});
......
......@@ -64,3 +64,7 @@
.pomodoroHighlight {
font-weight: bold;
}
#cancelPomodoroBtn {
float: left;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment