+
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 () {