From 52f884f2b1bdbf89eeafc355129bb7bfdbe978fc Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Wed, 22 Apr 2020 19:42:10 +0200 Subject: Use only one 'Apply' button for applying the user settings --- client/components/users/userHeader.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'client/components/users/userHeader.js') diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 5298e99a..b7bb284e 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -268,36 +268,31 @@ Template.changeSettingsPopup.events({ cookies.set('hasHiddenSystemMessages', 'true'); } }, - 'click .js-apply-show-cards-at'(event, templateInstance) { + 'click .js-apply-user-settings'(event, templateInstance) { event.preventDefault(); const minLimit = parseInt( templateInstance.$('#show-cards-count-at').val(), 10, ); + const startDay = parseInt( + templateInstance.$('#start-day-of-week').val(), + 10, + ); + const currentUser = Meteor.user(); if (!isNaN(minLimit)) { - currentUser = Meteor.user(); if (currentUser) { Meteor.call('changeLimitToShowCardsCount', minLimit); } else { cookies.set('limitToShowCardsCount', minLimit); } - Popup.back(); } - }, - 'click .js-apply-start-day-of-week'(event, templateInstance) { - event.preventDefault(); - const startDay = parseInt( - templateInstance.$('#start-day-of-week').val(), - 10, - ); if (!isNaN(startDay)) { - currentUser = Meteor.user(); if (currentUser) { Meteor.call('changeStartDayOfWeek', startDay); } else { cookies.set('startDayOfWeek', startDay); } - Popup.back(); } + Popup.back(); }, }); -- cgit v1.2.3-1-g7c22