From 1fb6f965710cbf092bd3990e413d7b0f8c153ccf Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 23 Apr 2022 16:51:04 +0200 Subject: [PATCH] minor shopping tweaks --- .../ShoppingListView/ShoppingListView.vue | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/vue/src/apps/ShoppingListView/ShoppingListView.vue b/vue/src/apps/ShoppingListView/ShoppingListView.vue index eeb709a2..69268082 100644 --- a/vue/src/apps/ShoppingListView/ShoppingListView.vue +++ b/vue/src/apps/ShoppingListView/ShoppingListView.vue @@ -112,21 +112,21 @@
-
-
+
{{ $t("Completed") }}
-
+
-
+
-
+
category -> food group -> entries) + // ordering/sorting is definied by the order in which categories are added to the sections array (even trough the dev console does not show it like this) function getKey(item, group_by, x) { switch (group_by) { case "category": @@ -934,10 +936,12 @@ export default { } var groups = {false: {}, true: {}} // force unchecked to always be first + // TODO: make nulls_first a user setting + // add undefined group to both the checked and non checked + groups.false[this.$t("Undefined")] = {} + groups.true[this.$t("Undefined")] = {} + // category order is defined by order of insertion into groups variable if (this.ui.selected_supermarket) { - // TODO: make nulls_first a user setting - groups.false[this.$t("Undefined")] = {} - groups.true[this.$t("Undefined")] = {} let super_cats = this.supermarkets .filter((x) => x.id === this.ui.selected_supermarket) .map((x) => x.category_to_supermarket) @@ -1021,7 +1025,7 @@ export default { watch: { ui: { handler() { - this.$cookies.set(SETTINGS_COOKIE_NAME, {ui: this.ui, settings: {entrymode: this.entrymode}}) + this.$cookies.set(SETTINGS_COOKIE_NAME, {ui: this.ui, settings: {entrymode: this.entrymode}}, "100y") if (this.entrymode) { this.$nextTick(function () { this.setFocus() @@ -1032,7 +1036,7 @@ export default { }, entrymode: { handler() { - this.$cookies.set(SETTINGS_COOKIE_NAME, {ui: this.ui, settings: {entrymode: this.entrymode}}) + this.$cookies.set(SETTINGS_COOKIE_NAME, {ui: this.ui, settings: {entrymode: this.entrymode}}, "100y") if (this.entrymode) { document.getElementById('shoppinglist').scrollTop = 0 this.$nextTick(function () {