|
@@ -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);
|