mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-22 03:07:57 +11:00
Added Esc to auto scroll to the bottom of the chat
This commit is contained in:
parent
1b59194a63
commit
2f6c524821
3 changed files with 36 additions and 21 deletions
|
@ -222,7 +222,7 @@
|
|||
z-index: 20;
|
||||
"
|
||||
width="100%"
|
||||
@click="forceBottom"
|
||||
@click="forceScroll"
|
||||
v-if="avoidAutoScroll"
|
||||
>
|
||||
<div>
|
||||
|
@ -437,7 +437,6 @@
|
|||
outlined
|
||||
autofocus
|
||||
@keydown.enter="doSearch"
|
||||
@keydown.esc="$store.state.searchPanel = false"
|
||||
></v-text-field>
|
||||
<v-list two-line color="card" ref="message-list-search">
|
||||
<template v-for="(message, index) in search.results">
|
||||
|
@ -775,7 +774,7 @@ export default {
|
|||
AjaxErrorHandler(this.$store)(e)
|
||||
})
|
||||
},
|
||||
forceBottom() {
|
||||
forceScroll() {
|
||||
this.avoidAutoScroll = false
|
||||
this.autoScroll()
|
||||
},
|
||||
|
@ -1115,6 +1114,13 @@ export default {
|
|||
if (document.activeElement.tagName === "BODY") {
|
||||
this.focusInput()
|
||||
}
|
||||
},
|
||||
escPressed(event) {
|
||||
if (event.key === "Escape" && !this.$store.state.searchPanel) {
|
||||
this.forceScroll()
|
||||
} else if (event.key === "Escape" && this.$store.state.searchPanel) {
|
||||
this.$store.state.searchPanel = false
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -1126,6 +1132,7 @@ export default {
|
|||
return
|
||||
}
|
||||
document.addEventListener("keypress", this.focusKey)
|
||||
document.addEventListener("keydown", this.escPressed)
|
||||
document
|
||||
.getElementById("message-list")
|
||||
.addEventListener("scroll", this.scrollEvent)
|
||||
|
@ -1252,6 +1259,7 @@ export default {
|
|||
if (!tryParse) {
|
||||
// remove event listeners
|
||||
document.removeEventListener("keypress", this.focusKey)
|
||||
document.removeEventListener("keydown", this.escPressed)
|
||||
document
|
||||
.getElementById("message-list")
|
||||
.removeEventListener("scroll", this.scrollEvent)
|
||||
|
@ -1283,6 +1291,7 @@ export default {
|
|||
},
|
||||
destroyed() {
|
||||
document.removeEventListener("keypress", this.focusKey)
|
||||
document.removeEventListener("keydown", this.escPressed)
|
||||
document.removeEventListener("scroll", this.scrollEvent)
|
||||
clearInterval(this.interval)
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ module.exports = {
|
|||
]
|
||||
},
|
||||
devServer: {
|
||||
proxy: "http://localhost:23998"
|
||||
proxy: "https://colubrina.troplo.com"
|
||||
},
|
||||
transpileDependencies: ["vuetify"]
|
||||
}
|
||||
|
|
|
@ -968,6 +968,11 @@
|
|||
ajv "^6.12.0"
|
||||
ajv-keywords "^3.4.1"
|
||||
|
||||
"@discoveryjs/json-ext@0.5.7":
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
|
||||
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
|
||||
|
||||
"@electron/get@^1.0.1":
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.14.1.tgz#16ba75f02dffb74c23965e72d617adc721d27f40"
|
||||
|
@ -2598,7 +2603,7 @@ browserify-zlib@^0.2.0:
|
|||
dependencies:
|
||||
pako "~1.0.5"
|
||||
|
||||
browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.21.3, browserslist@^4.21.4:
|
||||
browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.21.3, browserslist@^4.21.5:
|
||||
version "4.21.5"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7"
|
||||
integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==
|
||||
|
@ -2875,9 +2880,9 @@ caniuse-api@^3.0.0:
|
|||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001449:
|
||||
version "1.0.30001451"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001451.tgz#2e197c698fc1373d63e1406d6607ea4617c613f1"
|
||||
integrity sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==
|
||||
version "1.0.30001452"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001452.tgz#dff7b8bb834b3a91808f0a9ff0453abb1fbba02a"
|
||||
integrity sha512-Lkp0vFjMkBB3GTpLR8zk4NwW5EdRdnitwYJHDOOKIU85x4ckYCPQ+9WlVvSVClHxVReefkUMtWZH2l9KGlD51w==
|
||||
|
||||
case-sensitive-paths-webpack-plugin@^2.3.0:
|
||||
version "2.4.0"
|
||||
|
@ -3005,9 +3010,9 @@ ci-info@^2.0.0:
|
|||
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
|
||||
|
||||
ci-info@^3.2.0:
|
||||
version "3.7.1"
|
||||
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f"
|
||||
integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w==
|
||||
version "3.8.0"
|
||||
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"
|
||||
integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==
|
||||
|
||||
cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
|
||||
version "1.0.4"
|
||||
|
@ -3419,11 +3424,11 @@ copyfiles@^2.4.0:
|
|||
yargs "^16.1.0"
|
||||
|
||||
core-js-compat@^3.25.1, core-js-compat@^3.6.5:
|
||||
version "3.27.2"
|
||||
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.27.2.tgz#607c50ad6db8fd8326af0b2883ebb987be3786da"
|
||||
integrity sha512-welaYuF7ZtbYKGrIy7y3eb40d37rG1FvzEOfe7hSLd2iD6duMDqUhRfSvCGyC46HhR6Y8JXXdZ2lnRUMkPBpvg==
|
||||
version "3.28.0"
|
||||
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.28.0.tgz#c08456d854608a7264530a2afa281fadf20ecee6"
|
||||
integrity sha512-myzPgE7QodMg4nnd3K1TDoES/nADRStM8Gpz0D6nhkwbmwEnE0ZGJgoWsvQ722FR8D7xS0n0LV556RcEicjTyg==
|
||||
dependencies:
|
||||
browserslist "^4.21.4"
|
||||
browserslist "^4.21.5"
|
||||
|
||||
core-js@^2.4.0:
|
||||
version "2.6.12"
|
||||
|
@ -3431,9 +3436,9 @@ core-js@^2.4.0:
|
|||
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
|
||||
|
||||
core-js@^3.6.5:
|
||||
version "3.27.2"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.27.2.tgz#85b35453a424abdcacb97474797815f4d62ebbf7"
|
||||
integrity sha512-9ashVQskuh5AZEZ1JdQWp1GqSoC1e1G87MzRqg2gIfVAQ7Qn9K+uFj8EcniUFA4P2NLZfV+TOlX1SzoKfo+s7w==
|
||||
version "3.28.0"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.28.0.tgz#ed8b9e99c273879fdfff0edfc77ee709a5800e4a"
|
||||
integrity sha512-GiZn9D4Z/rSYvTeg1ljAIsEqFm0LaN9gVtwDCrKL80zHtS31p9BAjmTxVqTQDMpwlMolJZOFntUG2uwyj7DAqw==
|
||||
|
||||
core-util-is@1.0.2:
|
||||
version "1.0.2"
|
||||
|
@ -10730,10 +10735,11 @@ webpack-bundle-analyzer@^3.8.0:
|
|||
ws "^6.0.0"
|
||||
|
||||
webpack-bundle-analyzer@^4.5.0:
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.7.0.tgz#33c1c485a7fcae8627c547b5c3328b46de733c66"
|
||||
integrity sha512-j9b8ynpJS4K+zfO5GGwsAcQX4ZHpWV+yRiHDiL+bE0XHJ8NiPYLTNVQdlFYWxtpg9lfAQNlwJg16J9AJtFSXRg==
|
||||
version "4.8.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.8.0.tgz#951b8aaf491f665d2ae325d8b84da229157b1d04"
|
||||
integrity sha512-ZzoSBePshOKhr+hd8u6oCkZVwpVaXgpw23ScGLFpR6SjYI7+7iIWYarjN6OEYOfRt8o7ZyZZQk0DuMizJ+LEIg==
|
||||
dependencies:
|
||||
"@discoveryjs/json-ext" "0.5.7"
|
||||
acorn "^8.0.4"
|
||||
acorn-walk "^8.0.0"
|
||||
chalk "^4.1.0"
|
||||
|
|
Loading…
Reference in a new issue