1
0
mirror of https://github.com/kihashi/stardew_community_checklist.git synced 2025-10-19 08:03:17 +00:00

Added functions to save and load hideSpoilers.

This commit is contained in:
John Cleaver 2016-04-15 20:55:22 -04:00
parent 269437b009
commit 2392794900

10
main.js
View File

@ -35,10 +35,14 @@ var v = new Vue({
if(spoilers !== null && spoilers !== ""){
this.spoilers = JSON.parse(spoilers);
}
hideCompleted = localStorage.getItem('hideCompleted')
hideCompleted = localStorage.getItem('hideCompleted');
if(hideCompleted !== null && hideCompleted !== ""){
this.hideCompleted = hideCompleted;
}
hideSpoilers = localStorage.getItem('hideSpoilers');
if(hideSpoilers !== null && hideSpoilers !== ""){
this.hideSpoilers = hideSpoilers;
}
},
computed: {
user_data_serialized: function(){
@ -113,6 +117,10 @@ var v = new Vue({
this.hideCompleted = !this.hideCompleted;
localStorage.setItem('hideCompleted', this.hideCompleted);
},
toggleHideSpoilers: function(){
this.hideSpoilers = !this.hideSpoilers;
localStorage.setItem('hideSpoilers', this.hideSpoilers);
},
addItemToBundle: function(bundleId, itemId, itemPosition){
this.user_data[bundleId].push({item: itemId, position: itemPosition});
},