Compare commits

..

No commits in common. "38d18873b84edab15413212d1f227b2e94b4e392" and "be521a42ee61d5e463b78dbe4c86bb0d5b93c7a9" have entirely different histories.

6 changed files with 53 additions and 44 deletions

View File

@ -528,6 +528,10 @@ p.paginateContainer > *:not(:last-child) {
border-right: solid #869ab9 1px;
}
.choices__inner {
box-sizing: border-box;
}
@media screen and (max-width: 424px) {
div.gridContainer {
grid-template-columns: auto;

View File

@ -1,31 +1,17 @@
(function () {
const element = document.getElementById('newMember').elements['user_id'];
const select = new TomSelect(element, {
placeholder: 'User',
valueField: 'value',
labelField: 'label',
searchField: 'label',
loadThrottle: 300,
load: function (query, callback) {
var self = this;
RVR.httpRequest('GET', searchUserUrl.replace('QUERY', encodeURIComponent(query)), function () {
self.clearOptions();
callback(this.response.results);
});
},
const choices = new Choices(element, {
noResultsText: 'No users found',
noChoicesText: 'Start typing to search users'
});
select.on('change', function (value) {
this.clearOptions();
});
element.addEventListener('search', RVR.debounce(async function (e) {
RVR.httpRequest('GET', searchUserUrl.replace('QUERY', encodeURIComponent(e.detail.value)), function () {
choices.setChoices(this.response.results, 'value', 'label', true);
});
}));
select.on('blur', function (value) {
this.clearOptions();
});
select.on('type', function (value) {
if (value === '') {
this.clearOptions();
}
element.addEventListener('choice', function () {
choices.setChoices([], 'value', 'label', true);
});
})();

View File

@ -196,7 +196,7 @@ var RVR = {
}
}
form.elements['submit_button'].disabled = !anyChanged;
form.elements.submit.disabled = !anyChanged;
},
observeInputsInForm: function (form, observedInputs) {
@ -219,7 +219,7 @@ var RVR = {
}
form.onreset = function () {
form.elements['submit_button'].disabled = true;
form.elements.submit.disabled = true;
}
},

View File

@ -2,18 +2,33 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@orchidjs/sifter": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.0.3.tgz",
"integrity": "sha512-zCZbwKegHytfsPm8Amcfh7v/4vHqTAaOu6xFswBYcn8nznBOuseu6COB2ON7ez0tFV0mKL0nRNnCiZZA+lU9/g==",
"@babel/runtime": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
"integrity": "sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==",
"requires": {
"@orchidjs/unicode-variants": "^1.0.4"
"regenerator-runtime": "^0.13.11"
}
},
"@orchidjs/unicode-variants": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.0.4.tgz",
"integrity": "sha512-NvVBRnZNE+dugiXERFsET1JlKZfM5lJDEpSMilKW4bToYJ7pxf0Zne78xyXB2ny2c2aHfJ6WLnz1AaTNHAmQeQ=="
"choices.js": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/choices.js/-/choices.js-10.2.0.tgz",
"integrity": "sha512-8PKy6wq7BMjNwDTZwr3+Zry6G2+opJaAJDDA/j3yxvqSCnvkKe7ZIFfIyOhoc7htIWFhsfzF9tJpGUATcpUtPg==",
"requires": {
"deepmerge": "^4.2.2",
"fuse.js": "^6.6.2",
"redux": "^4.2.0"
}
},
"deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
},
"fuse.js": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",
"integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA=="
},
"leaflet": {
"version": "1.9.3",
@ -25,14 +40,18 @@
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.5.3.tgz",
"integrity": "sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA=="
},
"tom-select": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.2.2.tgz",
"integrity": "sha512-igGah1yY6yhrnN2h/Ky8I5muw/nE/YQxIsEZoYu5qaA4bsRibvKto3s8QZZosKpOd0uO8fNYhRfAwgHB4IAYew==",
"redux": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
"requires": {
"@orchidjs/sifter": "^1.0.3",
"@orchidjs/unicode-variants": "^1.0.4"
"@babel/runtime": "^7.9.2"
}
},
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
}
}
}

View File

@ -2,6 +2,6 @@
"dependencies": {
"leaflet": "^1.6.0",
"leaflet.markercluster": "^1.4.1",
"tom-select": "^2.2.2"
"choices.js": "^10.2.0"
}
}

View File

@ -1,5 +1,5 @@
@css(/static/node_modules/tom-select/dist/css/tom-select.min.css)
@js(/static/node_modules/tom-select/dist/js/tom-select.base.min.js)
@css(node_modules/choices.js/public/assets/styles/choices.min.css)
@js(node_modules/choices.js/public/assets/scripts/choices.js)
@js(js/communities/community_members.js)
@extends(templates/layout_normal)