@@ -26,8 +24,8 @@ import withapp from '../../../mixins/withapp'
import themeable from '../../../mixins/themeable'
import NScrollbar from '../../Scrollbar'
import NLogLoader from './LogLoader'
-import NFadeInHeightExpandTransition from '../../../transition/FadeInHeightExpandTransition'
import NLogLine from './LogLine'
+import NFadeInHeightExpandTransition from '../../../transition/FadeInHeightExpandTransition'
export default {
name: 'NLog',
diff --git a/packages/common/Scrollbar/src/main.vue b/packages/common/Scrollbar/src/main.vue
index ee0690be3..c56fd7078 100644
--- a/packages/common/Scrollbar/src/main.vue
+++ b/packages/common/Scrollbar/src/main.vue
@@ -25,6 +25,7 @@
@@ -45,6 +46,7 @@
@@ -95,6 +97,8 @@ export default {
contentWidth: null,
containerHeight: null,
containerWidth: null,
+ verticalRailHeight: null,
+ horizontalRailWidth: null,
containerScrollTop: null,
containerScrollLeft: null,
horizontalScrollbarVanishTimerId: null,
@@ -112,27 +116,27 @@ export default {
},
computed: {
verticalScrollbarHeight () {
- if (this.containerHeight === null || this.contentHeight === null) return 0
+ if (this.containerHeight === null || this.contentHeight === null || this.verticalRailHeight === null) return 0
else {
- return (this.containerHeight * this.containerHeight / this.contentHeight + this.width * 1.5)
+ return (this.verticalRailHeight * this.containerHeight / this.contentHeight + this.width * 1.5)
}
},
verticalScrollbarHeightPx () {
return this.verticalScrollbarHeight + 'px'
},
horizontalScrollbarWidth () {
- if (this.containerWidth === null || this.contentWidth === null) return 0
+ if (this.containerWidth === null || this.contentWidth === null || this.horizontalRailWidth === null) return 0
else {
- return (this.containerWidth * this.containerWidth / this.contentWidth + this.width * 1.5)
+ return (this.horizontalRailWidth * this.containerWidth / this.contentWidth + this.width * 1.5)
}
},
horizontalScrollbarWidthPx () {
return this.horizontalScrollbarWidth + 'px'
},
verticalScrollbarTop () {
- if (this.containerHeight === null || this.containerScrollTop === null || this.contentHeight === null) return 0
+ if (this.containerHeight === null || this.containerScrollTop === null || this.contentHeight === null || this.verticalRailHeight === null) return 0
else {
- return this.containerScrollTop / (this.contentHeight - this.containerHeight) * (this.containerHeight - this.verticalScrollbarHeight)
+ return this.containerScrollTop / (this.contentHeight - this.containerHeight) * (this.verticalRailHeight - this.verticalScrollbarHeight)
}
},
verticalScrollbarTopPx () {
@@ -141,7 +145,7 @@ export default {
horizontalScrollbarLeft () {
if (this.containerWidth === null || this.containerScrollLeft === null || this.contentWidth === null) return 0
else {
- return this.containerScrollLeft / (this.contentWidth - this.containerWidth) * (this.containerWidth - this.horizontalScrollbarWidth)
+ return this.containerScrollLeft / (this.contentWidth - this.containerWidth) * (this.horizontalRailWidth - this.horizontalScrollbarWidth)
}
},
horizontalScrollbarLeftPx () {
@@ -287,6 +291,12 @@ export default {
this.containerHeight = this.$refs.scrollContainer.offsetHeight
this.containerWidth = this.$refs.scrollContainer.offsetWidth
}
+ if (this.$refs.horizontalRail) {
+ this.horizontalRailWidth = this.$refs.horizontalRail.offsetWidth
+ }
+ if (this.$refs.verticalRail) {
+ this.verticalRailHeight = this.$refs.verticalRail.offsetHeight
+ }
},
updateParameters () {
this.updatePositionParameters()
diff --git a/styles/Log.scss b/styles/Log.scss
index b6991f10b..73eb530d2 100644
--- a/styles/Log.scss
+++ b/styles/Log.scss
@@ -14,11 +14,20 @@
@include m(bottom-bordered) {
border-bottom: 1px solid $--n-border-color;
}
- @include b(scrollbar-content) {
- padding-top: 8px;
- padding-bottom: 8px;
- overflow: hidden;
+ @include b(scrollbar) {
+ @include b(scrollbar-content) {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ overflow: hidden;
+ }
+ @include b(scrollbar-rail) {
+ @include m(vertical) {
+ top: 8px;
+ bottom: 8px
+ }
+ }
}
+
@include e(lines) {
margin: 0;
white-space: pre-wrap;