mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 04:53:09 +02:00
🎨
This commit is contained in:
parent
6b22b7a31f
commit
49b43eb3c8
1 changed files with 8 additions and 4 deletions
|
@ -91,11 +91,15 @@ export default defineComponent({
|
|||
bg.setAlpha(0.85);
|
||||
this.bg = bg.toRgbString();
|
||||
|
||||
if (this.$el.parentElement == null) return;
|
||||
this.narrow = this.$el.parentElement.offsetWidth < 500;
|
||||
new ResizeObserver((entries, observer) => {
|
||||
if (this.$el.parentElement) {
|
||||
this.narrow = this.$el.parentElement.offsetWidth < 500;
|
||||
}).observe(this.$el.parentElement);
|
||||
new ResizeObserver((entries, observer) => {
|
||||
this.narrow = this.$el.parentElement.offsetWidth < 500;
|
||||
}).observe(this.$el.parentElement);
|
||||
const currentStickyTop = getComputedStyle(this.$el).getPropertyValue('--stickyTop') || '0px';
|
||||
this.$el.style.setProperty('--stickyTop', currentStickyTop);
|
||||
this.$el.parentElement.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${this.$el.offsetHeight}px)`);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
Loading…
Reference in a new issue