mirror of
https://github.com/Av0idD4rk/packmate.git
synced 2026-10-23 21:42:06 +00:00
Исправил прокрутку
This commit is contained in:
parent
6542e06ecd
commit
c7d16103d7
@ -39,6 +39,11 @@ export default {
|
|||||||
name: 'home',
|
name: 'home',
|
||||||
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
||||||
});
|
});
|
||||||
|
document.getElementById(`stream-${newId}`).scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'center',
|
||||||
|
inline: 'center',
|
||||||
|
});
|
||||||
} else if (e.key === 'ArrowDown') {
|
} else if (e.key === 'ArrowDown') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const index = this.$data.streams.findIndex(e => e.id === this.$props.streamId);
|
const index = this.$data.streams.findIndex(e => e.id === this.$props.streamId);
|
||||||
@ -49,6 +54,11 @@ export default {
|
|||||||
name: 'home',
|
name: 'home',
|
||||||
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
||||||
});
|
});
|
||||||
|
document.getElementById(`stream-${newId}`).scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'center',
|
||||||
|
inline: 'center',
|
||||||
|
});
|
||||||
} else if (e.key === 'Home') {
|
} else if (e.key === 'Home') {
|
||||||
const newStream = this.$data.streams[0];
|
const newStream = this.$data.streams[0];
|
||||||
if (!newStream) return;
|
if (!newStream) return;
|
||||||
@ -57,6 +67,11 @@ export default {
|
|||||||
name: 'home',
|
name: 'home',
|
||||||
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
||||||
});
|
});
|
||||||
|
document.getElementById(`stream-${newId}`).scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'center',
|
||||||
|
inline: 'center',
|
||||||
|
});
|
||||||
} else if (e.key === 'End') {
|
} else if (e.key === 'End') {
|
||||||
const newStream = this.$data.streams[this.$data.streams.length - 1];
|
const newStream = this.$data.streams[this.$data.streams.length - 1];
|
||||||
if (!newStream) return;
|
if (!newStream) return;
|
||||||
@ -65,6 +80,11 @@ export default {
|
|||||||
name: 'home',
|
name: 'home',
|
||||||
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
params: {servicePort: this.$props.servicePort, streamId: newId,},
|
||||||
});
|
});
|
||||||
|
document.getElementById(`stream-${newId}`).scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'center',
|
||||||
|
inline: 'center',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -127,10 +147,10 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {Stream, InfiniteLoading,},
|
components: {Stream, InfiniteLoading,},
|
||||||
mounted() {
|
mounted() {
|
||||||
document.addEventListener('keyup', this.$data.navigationKeysCallback);
|
document.addEventListener('keydown', this.$data.navigationKeysCallback);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
document.removeEventListener('keyup', this.$data.navigationKeysCallback);
|
document.removeEventListener('keydown', this.$data.navigationKeysCallback);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<li class="nav-item">
|
<li :id="`stream-${id}`" class="nav-item">
|
||||||
<router-link class="nav-link" active-class="active" :to="{ name: 'home', params: { servicePort: servicePort, streamId: id}, query: $route.query }">
|
<router-link class="nav-link" active-class="active" :to="{ name: 'home', params: { servicePort: servicePort, streamId: id}, query: $route.query }">
|
||||||
#{{id}} {{proto}}<br/>
|
#{{id}} {{proto}}<br/>
|
||||||
{{new Date(startTime).toLocaleDateString('ru-RU', {month: '2-digit', day: '2-digit', hour:'2-digit', minute: '2-digit', second: '2-digit'})}}
|
{{new Date(startTime).toLocaleDateString('ru-RU', {month: '2-digit', day: '2-digit', hour:'2-digit', minute: '2-digit', second: '2-digit'})}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user