Skip to content

Commit

Permalink
added shortcut to run simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeuscher committed Jun 15, 2024
1 parent 1220146 commit 47adf37
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/frontend/LT1Main/LT1Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export default defineComponent({
ChartAGP,
},
created() {
window.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.key == 'Enter') {
this.run()
}
})
},
data() {
return {
patient: {} as Patient,
Expand Down Expand Up @@ -200,7 +208,7 @@ export default defineComponent({
<MealTable v-if='options.t0' :t0="options.t0" @mealsChanged="mealsChanged" ref="meals" />
<ExerciseTable v-if='options.t0' :t0="options.t0" @exercisesChanged="exercisesChanged" />
<SimulationOptionsConfig @valueChanged="optionsChanged" ref="options" />
<div>
<div style="text-align:center;">
<input type="button" id="startbutton" :value="$t('run')" @click="run" v-tooltip="{
global: true,
theme: {
Expand All @@ -209,6 +217,10 @@ export default defineComponent({
padding: '2rem'
},
}">
<br/>
<div style="font-size: 0.8em;">
{{ $t("shortcut") }}
</div>
</div>
</div>
<div class="box lt1-results">
Expand All @@ -226,11 +238,9 @@ export default defineComponent({
/* button "run simulation" */
input#startbutton {
float: right;
margin: 1rem;
margin: 1rem 0rem 0.2rem;
padding: 0.5rem;
font-size: 1rem;
padding: 0.5em;
}
</style>
Expand All @@ -241,12 +251,14 @@ input#startbutton {
"settings": "Settings",
"run": "run simulation",
"results": "Results",
"shortcut": "or press Ctrl+Enter",
}
</i18n>
<i18n locale="de">
{
"settings": "Einstellungen",
"run": "Simulation starten",
"results": "Ergebnisse",
"shortcut": "oder Strg+Eingabe drücken"
}
</i18n>

0 comments on commit 47adf37

Please sign in to comment.