Merge pull request #1772 from chakflying/fix/mobile-monitor-list

Fix: Fix monitor list layout on mobile
This commit is contained in:
Louis Lam 2022-06-15 15:50:04 +08:00 committed by GitHub
commit da91317760
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 8 deletions

View file

@ -383,6 +383,12 @@ optgroup {
height: calc(100% - 65px);
}
@media (max-width: 770px) {
&.scrollbar {
height: calc(100% - 40px);
}
}
.item {
display: block;
text-decoration: none;

View file

@ -69,10 +69,22 @@ export default {
};
},
computed: {
/**
* Improve the sticky appearance of the list by increasing its
* height as user scrolls down.
* Not used on mobile.
*/
boxStyle() {
if (window.innerWidth > 550) {
return {
height: `calc(100vh - 160px + ${this.windowTop}px)`,
};
} else {
return {
height: "calc(100vh - 160px)",
};
}
},
sortedMonitorList() {

View file

@ -1,6 +1,6 @@
<template>
<transition name="slide-fade" appear>
<MonitorList />
<MonitorList :scrollbar="true" />
</transition>
</template>
@ -14,3 +14,11 @@ export default {
};
</script>
<style lang="scss" scoped>
@import "../assets/vars";
.shadow-box {
padding: 20px;
}
</style>

View file

@ -65,12 +65,12 @@ const routes = [
path: "/add",
component: EditMonitor,
},
],
},
{
path: "/list",
component: List,
},
],
},
{
path: "/settings",
component: Settings,