add option to get asked whether unsaved card descriptions should be saved to db on e.g. unintentional click out of card details pane

This commit is contained in:
viehlieb 2022-07-18 15:05:22 +02:00
parent b00169d24f
commit b3056626f3
7 changed files with 65 additions and 19 deletions

View file

@ -297,6 +297,16 @@ Template.changeSettingsPopup.helpers({
return false;
}
},
rescueCardDescription() {
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).rescueCardDescription;
} else if (window.localStorage.getItem('rescueCardDescription')) {
return true;
} else {
return false;
}
},
showCardsCountAt() {
currentUser = Meteor.user();
if (currentUser) {
@ -356,6 +366,9 @@ Template.changeSettingsPopup.events({
window.localStorage.setItem('hasHiddenSystemMessages', 'true');
}
},
'click .js-rescue-card-description'() {
Meteor.call('toggleRescueCardDescription')
},
'click .js-apply-user-settings'(event, templateInstance) {
event.preventDefault();
let minLimit = parseInt(