mirror of
https://github.com/wekan/wekan.git
synced 2026-02-14 12:14:21 +01:00
Use only one 'Apply' button for applying the user settings
This commit is contained in:
parent
4550e10fbe
commit
52f884f2b1
2 changed files with 10 additions and 17 deletions
|
|
@ -112,13 +112,11 @@ template(name="changeSettingsPopup")
|
||||||
i.fa.fa-check
|
i.fa.fa-check
|
||||||
unless currentUser.isWorker
|
unless currentUser.isWorker
|
||||||
li
|
li
|
||||||
label.bold
|
label.bold.clear
|
||||||
i.fa.fa-sort-numeric-asc
|
i.fa.fa-sort-numeric-asc
|
||||||
| {{_ 'show-cards-minimum-count'}}
|
| {{_ 'show-cards-minimum-count'}}
|
||||||
input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="0" max="99" onkeydown="return false")
|
input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="0" max="99" onkeydown="return false")
|
||||||
input.js-apply-show-cards-at.left(type="submit" value="{{_ 'apply'}}")
|
label.bold.clear
|
||||||
li
|
|
||||||
label.bold
|
|
||||||
i.fa.fa-calendar
|
i.fa.fa-calendar
|
||||||
| {{_ 'start-day-of-week'}}
|
| {{_ 'start-day-of-week'}}
|
||||||
select#start-day-of-week.inline-input.left
|
select#start-day-of-week.inline-input.left
|
||||||
|
|
@ -127,7 +125,7 @@ template(name="changeSettingsPopup")
|
||||||
option(selected="true", value="#{day.value}") #{day.name}
|
option(selected="true", value="#{day.value}") #{day.name}
|
||||||
else
|
else
|
||||||
option(value="#{day.value}") #{day.name}
|
option(value="#{day.value}") #{day.name}
|
||||||
input.js-apply-start-day-of-week.left(type="submit" value="{{_ 'apply'}}")
|
input.js-apply-user-settings.left(type="submit" value="{{_ 'apply'}}")
|
||||||
|
|
||||||
template(name="userDeletePopup")
|
template(name="userDeletePopup")
|
||||||
unless currentUser.isWorker
|
unless currentUser.isWorker
|
||||||
|
|
|
||||||
|
|
@ -268,36 +268,31 @@ Template.changeSettingsPopup.events({
|
||||||
cookies.set('hasHiddenSystemMessages', 'true');
|
cookies.set('hasHiddenSystemMessages', 'true');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'click .js-apply-show-cards-at'(event, templateInstance) {
|
'click .js-apply-user-settings'(event, templateInstance) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const minLimit = parseInt(
|
const minLimit = parseInt(
|
||||||
templateInstance.$('#show-cards-count-at').val(),
|
templateInstance.$('#show-cards-count-at').val(),
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
|
const startDay = parseInt(
|
||||||
|
templateInstance.$('#start-day-of-week').val(),
|
||||||
|
10,
|
||||||
|
);
|
||||||
|
const currentUser = Meteor.user();
|
||||||
if (!isNaN(minLimit)) {
|
if (!isNaN(minLimit)) {
|
||||||
currentUser = Meteor.user();
|
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
||||||
} else {
|
} else {
|
||||||
cookies.set('limitToShowCardsCount', minLimit);
|
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)) {
|
if (!isNaN(startDay)) {
|
||||||
currentUser = Meteor.user();
|
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
Meteor.call('changeStartDayOfWeek', startDay);
|
Meteor.call('changeStartDayOfWeek', startDay);
|
||||||
} else {
|
} else {
|
||||||
cookies.set('startDayOfWeek', startDay);
|
cookies.set('startDayOfWeek', startDay);
|
||||||
}
|
}
|
||||||
Popup.back();
|
|
||||||
}
|
}
|
||||||
|
Popup.back();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue