Card Details, description edit is now saved at popup

This commit is contained in:
Martin Filser 2021-10-18 16:32:57 +02:00
parent 125c84b6b5
commit fb66b84b58
5 changed files with 36 additions and 11 deletions

View file

@ -537,6 +537,13 @@ BlazeComponent.extendComponent({
},
}).register('cardDetails');
Template.cardDetailsPopup.helpers({
popupCard() {
const ret = Utils.getPopupCard();
return ret;
},
});
BlazeComponent.extendComponent({
template() {
return 'exportCard';
@ -587,16 +594,15 @@ Template.editCardSortOrderForm.onRendered(function () {
// XXX Recovering the currentCard identifier form a session variable is
// fragile because this variable may change for instance if the route
// change. We should use some component props instead.
docId: Session.get('currentCard'),
docId: Utils.getCurrentCardId(),
};
}
close(isReset = false) {
if (this.isOpen.get() && !isReset) {
const draft = this.getValue().trim();
if (
draft !== Cards.findOne(Session.get('currentCard')).getDescription()
) {
let card = Utils.getCurrentCard();
if (card && draft !== card.getDescription()) {
UnsavedEdits.set(this._getUnsavedEditKey(), this.getValue());
}
}