mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Settings, "Show cards count" keyboard input possible
This commit is contained in:
parent
2972351e79
commit
b79fc53265
2 changed files with 12 additions and 2 deletions
|
|
@ -143,7 +143,7 @@ template(name="changeSettingsPopup")
|
||||||
label.bold.clear
|
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")
|
||||||
label.bold.clear
|
label.bold.clear
|
||||||
i.fa.fa-calendar
|
i.fa.fa-calendar
|
||||||
| {{_ 'start-day-of-week'}}
|
| {{_ 'start-day-of-week'}}
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,13 @@ Template.changeSettingsPopup.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.changeSettingsPopup.events({
|
Template.changeSettingsPopup.events({
|
||||||
|
'keypress/paste #show-cards-count-at'() {
|
||||||
|
let keyCode = event.keyCode;
|
||||||
|
let charCode = String.fromCharCode(keyCode);
|
||||||
|
let regex = new RegExp("[0-9]");
|
||||||
|
let ret = regex.test(charCode);
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
'click .js-toggle-desktop-drag-handles'() {
|
'click .js-toggle-desktop-drag-handles'() {
|
||||||
currentUser = Meteor.user();
|
currentUser = Meteor.user();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
|
|
@ -293,7 +300,7 @@ Template.changeSettingsPopup.events({
|
||||||
},
|
},
|
||||||
'click .js-apply-user-settings'(event, templateInstance) {
|
'click .js-apply-user-settings'(event, templateInstance) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const minLimit = parseInt(
|
let minLimit = parseInt(
|
||||||
templateInstance.$('#show-cards-count-at').val(),
|
templateInstance.$('#show-cards-count-at').val(),
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
|
|
@ -302,6 +309,9 @@ Template.changeSettingsPopup.events({
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
const currentUser = Meteor.user();
|
const currentUser = Meteor.user();
|
||||||
|
if (isNaN(minLimit)) {
|
||||||
|
minLimit = 0;
|
||||||
|
}
|
||||||
if (!isNaN(minLimit)) {
|
if (!isNaN(minLimit)) {
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
Meteor.call('changeLimitToShowCardsCount', minLimit);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue