Skip to content

Resize plans properly #7597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/ui/components/TimeSystemAxis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@
},
setup() {
const axisHolder = ref(null);
const { size, startObserving } = useResizeObserver();
const { size: containerSize, startObserving } = useResizeObserver();
onMounted(() => {
startObserving(axisHolder.value);
});
return {
containerSize: size
axisHolder,
containerSize
};
},
watch: {
Expand All @@ -95,16 +96,19 @@
contentHeight() {
this.updateNowMarker();
},
containerSize() {
this.resize();
containerSize: {
handler() {
this.resize();

Check warning on line 101 in src/ui/components/TimeSystemAxis.vue

View check run for this annotation

Codecov / codecov/patch

src/ui/components/TimeSystemAxis.vue#L101

Added line #L101 was not covered by tests
},
deep: true
}
},
mounted() {
if (this.renderingEngine === 'svg') {
this.useSVG = true;
}

this.container = select(this.$refs.axisHolder);
this.container = select(this.axisHolder);
this.svgElement = this.container.append('svg:svg');
// draw x axis with labels. CSS is used to position them.
this.axisElement = this.svgElement
Expand All @@ -122,7 +126,7 @@
},
methods: {
resize() {
if (this.$refs.axisHolder.clientWidth !== this.width) {
if (this.axisHolder.clientWidth !== this.width) {
this.setDimensions();
this.drawAxis(this.bounds, this.timeSystem);
this.updateNowMarker();
Expand All @@ -139,7 +143,7 @@
}
},
setDimensions() {
const axisHolder = this.$refs.axisHolder;
const axisHolder = this.axisHolder;
this.width = axisHolder.clientWidth;
this.offsetWidth = this.width - this.offset;

Expand Down
Loading