Skip to content

Commit

Permalink
Merge pull request #79 from dacoaster/da/hotkeys-and-bugfixes
Browse files Browse the repository at this point in the history
Da/hotkeys and bugfixes
  • Loading branch information
dacoaster authored Aug 28, 2023
2 parents cf71583 + 01d713e commit 4c52b7c
Show file tree
Hide file tree
Showing 34 changed files with 1,336 additions and 211 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yattie",
"version": "0.9.1",
"version": "0.10.0",
"engines": {
"npm": ">=8.0.0 <9.0.0",
"node": ">=16.0.0 <17.0.0"
Expand Down Expand Up @@ -58,6 +58,7 @@
"vue-i18n-bridge": "^9.2.0-beta.10",
"vue-input-tag": "^2.0.7",
"vue-router": "^3.5.1",
"vue-shortkey": "^3.1.7",
"vuedraggable": "^2.24.3",
"vuetify": "^2.6.0",
"vuex": "^3.6.2",
Expand Down
31 changes: 26 additions & 5 deletions src/components/CheckTaskWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
>
{{ $tc("caption.checklist", 1) }}
</div>
<div class="list">
<div
class="list"
v-shortkey="checklistHotkey"
@shortkey="$hotkeyHelpers.focusField($refs, 'form')"
>
<v-form ref="form" v-model="valid" lazy-validation>
<div class="" v-for="task in tasks" :key="task.id">
<v-checkbox
Expand All @@ -33,6 +37,10 @@
export default {
name: "CheckTaskWrapper",
props: {
configItem: {
type: Object,
default: () => {},
},
tasks: {
type: Array,
default: () => [],
Expand All @@ -45,6 +53,7 @@ export default {
data() {
return {
valid: true,
config: this.configItem,
};
},
mounted() {
Expand All @@ -53,6 +62,12 @@ export default {
});
},
computed: {
checklistHotkey() {
return this.$hotkeyHelpers.findBinding(
"sessionPlanning.checklist",
this.config.hotkeys
);
},
currentTheme() {
if (this.$vuetify.theme.dark) {
return this.$vuetify.theme.themes.dark;
Expand All @@ -61,6 +76,11 @@ export default {
}
},
},
watch: {
configItem: function (newValue) {
this.config = newValue;
},
},
methods: {
rules(required) {
if (required) {
Expand All @@ -70,10 +90,11 @@ export default {
}
},
handleValidate() {
const isValid = this.$refs.form.validate();
if (!isValid) {
const el = document.querySelector(".v-messages__wrapper:first-of-type");
el.scrollIntoView();
if (this.$refs.form) {
const isValid = this.$refs.form.validate();
if (!isValid) {
this.$refs.form.$el.scrollIntoView();
}
}
},
},
Expand Down
Loading

0 comments on commit 4c52b7c

Please sign in to comment.