UX: Remember view type of search results and albums #2477

This commit is contained in:
Michael Mayer 2022-06-28 19:28:34 +02:00
parent b47d71d659
commit 9ec854d57c
6 changed files with 25 additions and 13 deletions

View file

@ -141,12 +141,12 @@ export default {
},
methods: {
viewType() {
let queryParam = this.$route.query['view'];
let defaultType = window.localStorage.getItem("photo_view_type");
let storedType = window.localStorage.getItem("album_view_type");
let queryParam = this.$route.query['view'] ? this.$route.query['view'] : "";
let defaultType = window.localStorage.getItem("photos_view");
let storedType = window.localStorage.getItem("album_photos_view");
if (queryParam) {
window.localStorage.setItem("album_view_type", queryParam);
window.localStorage.setItem("album_photos_view", queryParam);
return queryParam;
} else if (storedType) {
return storedType;
@ -294,6 +294,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("album_photos_"+key, this.settings[key]);
}
},
updateFilter(props) {

View file

@ -505,6 +505,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("albums_"+key, this.settings[key]);
}
},
updateFilter(props) {

View file

@ -431,6 +431,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("labels_"+key, this.settings[key]);
}
},
updateFilter(props) {

View file

@ -539,6 +539,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("people_"+key, this.settings[key]);
}
},
updateFilter(props) {

View file

@ -178,11 +178,11 @@ export default {
},
methods: {
viewType() {
let queryParam = this.$route.query["view"];
let storedType = window.localStorage.getItem("photo_view");
let queryParam = this.$route.query['view'] ? this.$route.query['view'] : "";
let storedType = window.localStorage.getItem("photos_view");
if (queryParam) {
window.localStorage.setItem("photo_view", queryParam);
window.localStorage.setItem("photos_view", queryParam);
return queryParam;
} else if (storedType) {
return storedType;
@ -194,10 +194,10 @@ export default {
},
sortOrder() {
let queryParam = this.$route.query["order"];
let storedType = window.localStorage.getItem("photo_order");
let storedType = window.localStorage.getItem("photos_order");
if (queryParam) {
window.localStorage.setItem("photo_order", queryParam);
window.localStorage.setItem("photos_order", queryParam);
return queryParam;
} else if (storedType) {
return storedType;
@ -339,6 +339,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("photos_"+key, this.settings[key]);
}
},
updateFilter(props) {

View file

@ -201,12 +201,12 @@ export default {
this.updateQuery();
},
viewType() {
let queryParam = this.$route.query['view'];
let defaultType = window.localStorage.getItem("photo_view_type");
let storedType = window.localStorage.getItem("album_view_type");
let queryParam = this.$route.query['view'] ? this.$route.query['view'] : "";
let defaultType = window.localStorage.getItem("photos_view");
let storedType = window.localStorage.getItem("share_photos_view");
if (queryParam) {
window.localStorage.setItem("album_view_type", queryParam);
window.localStorage.setItem("share_photos_view", queryParam);
return queryParam;
} else if (storedType) {
return storedType;
@ -354,6 +354,8 @@ export default {
default:
this.settings[key] = value;
}
window.localStorage.setItem("share_photos_"+key, this.settings[key]);
}
},
updateFilter(props) {