only add left margin to container

This commit is contained in:
Scott Bell 2024-12-16 20:19:52 +01:00
parent 62b4975d57
commit 20247bbd87

View File

@ -21,7 +21,11 @@
--> -->
<template> <template>
<div ref="events" class="c-events-tsv c-timeline-holder c-events-tsv__contents" /> <div
ref="events"
class="c-events-tsv c-timeline-holder c-events-tsv__contents"
:style="{ left: leftOffset + 'px' }"
/>
</template> </template>
<script> <script>
@ -70,6 +74,11 @@ export default {
selectedEvent: null selectedEvent: null
}; };
}, },
computed: {
leftOffset() {
return this.alignmentData.leftWidth + AXES_PADDING;
}
},
watch: { watch: {
eventHistory: { eventHistory: {
handler(newHistory, oldHistory) { handler(newHistory, oldHistory) {
@ -365,7 +374,7 @@ export default {
} }
}, },
updateExistingEventWrapper(existingEventWrapper, event) { updateExistingEventWrapper(existingEventWrapper, event) {
existingEventWrapper.style.left = `${this.xScale(event.time) + this.alignmentData.leftWidth + AXES_PADDING}px`; existingEventWrapper.style.left = `${this.xScale(event.time)}px`;
}, },
createPathSelection() { createPathSelection() {
const selection = []; const selection = [];
@ -421,7 +430,7 @@ export default {
eventWrapper.ariaLabel = id; eventWrapper.ariaLabel = id;
eventWrapper.setAttribute('id', id); eventWrapper.setAttribute('id', id);
eventWrapper.classList.add(EVENT_WRAPPER_CLASS); eventWrapper.classList.add(EVENT_WRAPPER_CLASS);
eventWrapper.style.left = `${this.xScale(event.time) + this.alignmentData.leftWidth + AXES_PADDING}px`; eventWrapper.style.left = `${this.xScale(event.time)}px`;
const eventTickElement = document.createElement('div'); const eventTickElement = document.createElement('div');
eventTickElement.classList.add('c-events-tsv__event-handle'); eventTickElement.classList.add('c-events-tsv__event-handle');
eventTickElement.style.width = '2px'; eventTickElement.style.width = '2px';