mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-20 10:39:30 -07:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a8fa470c | ||
|
|
8489b7e2be | ||
|
|
93ac03acd4 |
@@ -151,6 +151,7 @@ const upload = () => src(uploadSources, { base: './dist', encoding: false })
|
||||
const imageSources = [
|
||||
'server/fonts/**',
|
||||
'server/images/**',
|
||||
'!server/images/gimp/**',
|
||||
];
|
||||
const uploadImages = () => src(imageSources, { base: './server', encoding: false })
|
||||
.pipe(
|
||||
|
||||
541
package-lock.json
generated
541
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ws4kp",
|
||||
"version": "5.18.0",
|
||||
"version": "5.18.1",
|
||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||
"main": "index.mjs",
|
||||
"type": "module",
|
||||
@@ -42,12 +42,12 @@
|
||||
"suncalc": "^1.8.0",
|
||||
"swiped-events": "^1.1.4",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"webpack-stream": "^7.0.0"
|
||||
"webpack-stream": "^7.0.0",
|
||||
"gulp-html-minifier-terser": "^7.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^16.5.0",
|
||||
"ejs": "^3.1.5",
|
||||
"express": "^5.1.0",
|
||||
"gulp-html-minifier-terser": "^7.1.0"
|
||||
"express": "^5.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,9 @@ class AutoComplete {
|
||||
this.elem.addEventListener('keyup', (e) => this.keyUp(e));
|
||||
this.elem.closest('form')?.addEventListener('submit', (e) => this.directFormSubmit(e));
|
||||
this.elem.addEventListener('click', () => this.deselectAll());
|
||||
this.elem.addEventListener('focusout', () => this.hideSuggestions());
|
||||
|
||||
// clicking outside the suggestion box requires a bit of work to determine if suggestions should be hidden
|
||||
document.addEventListener('click', (e) => this.checkOutsideClick(e));
|
||||
}
|
||||
|
||||
mouseOver(e) {
|
||||
@@ -138,6 +140,9 @@ class AutoComplete {
|
||||
|
||||
// up/down direction
|
||||
switch (e.which) {
|
||||
case KEYS.ESC:
|
||||
this.hideSuggestions();
|
||||
return;
|
||||
case KEYS.UP:
|
||||
case KEYS.DOWN:
|
||||
// move up or down the selection list
|
||||
@@ -302,6 +307,13 @@ class AutoComplete {
|
||||
[...this.results.querySelectorAll('.suggestion.selected')].forEach((elem) => elem.classList.remove('selected'));
|
||||
this.selectedItem = 0;
|
||||
}
|
||||
|
||||
// if a click is detected on the page, generally we hide the suggestions, unless the click was within the autocomplete elements
|
||||
checkOutsideClick(e) {
|
||||
if (e.target.id === 'txtAddress') return;
|
||||
if (e.target?.parentNode?.classList.contains(this.options.containerClass)) return;
|
||||
this.hideSuggestions();
|
||||
}
|
||||
}
|
||||
|
||||
export default AutoComplete;
|
||||
|
||||
Reference in New Issue
Block a user