stricter CSP compat in appearance tab
This commit is contained in:
parent
ee0c73446e
commit
9fbf426388
2 changed files with 5 additions and 21 deletions
|
|
@ -155,13 +155,15 @@ const AppearanceTab = {
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.previewTheme('stock', 'v3')
|
||||||
|
|
||||||
if (window.IntersectionObserver) {
|
if (window.IntersectionObserver) {
|
||||||
this.intersectionObserver = new IntersectionObserver((entries, observer) => {
|
this.intersectionObserver = new IntersectionObserver((entries, observer) => {
|
||||||
entries.forEach(({ target, isIntersecting }) => {
|
entries.forEach(({ target, isIntersecting }) => {
|
||||||
if (!isIntersecting) return
|
if (!isIntersecting) return
|
||||||
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
|
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (theme) theme.ready = true
|
if (theme) this.previewTheme(theme.key, theme.version, theme.data)
|
||||||
})
|
})
|
||||||
observer.unobserve(target)
|
observer.unobserve(target)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,7 @@
|
||||||
:disabled="switchInProgress"
|
:disabled="switchInProgress"
|
||||||
@click="resetTheming"
|
@click="resetTheming"
|
||||||
>
|
>
|
||||||
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
<preview id="theme-preview-stock"/>
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<component
|
|
||||||
:is="'style'"
|
|
||||||
v-html="previewTheme('stock', 'v3')"
|
|
||||||
/>
|
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
<!-- eslint-enable vue/no-v-text-v-html-on-component -->
|
|
||||||
<preview id="theme-preview-stock" />
|
|
||||||
<h4 class="theme-name">
|
<h4 class="theme-name">
|
||||||
{{ $t('settings.style.stock_theme_used') }}
|
{{ $t('settings.style.stock_theme_used') }}
|
||||||
<span class="alert neutral version">v3</span>
|
<span class="alert neutral version">v3</span>
|
||||||
|
|
@ -61,17 +53,7 @@
|
||||||
:disabled="switchInProgress"
|
:disabled="switchInProgress"
|
||||||
@click="style.version === 'v2' ? setTheme(style.key) : setStyle(style.key)"
|
@click="style.version === 'v2' ? setTheme(style.key) : setStyle(style.key)"
|
||||||
>
|
>
|
||||||
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
<preview :id="'theme-preview-' + style.key"/>
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<div v-if="style.ready || noIntersectionObserver">
|
|
||||||
<component
|
|
||||||
:is="'style'"
|
|
||||||
v-html="previewTheme(style.key, style.version, style.data)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
<!-- eslint-enable vue/no-v-text-v-html-on-component -->
|
|
||||||
<preview :id="'theme-preview-' + style.key" />
|
|
||||||
<h4 class="theme-name">
|
<h4 class="theme-name">
|
||||||
{{ style.name }}
|
{{ style.name }}
|
||||||
<span class="alert neutral version">{{ style.version }}</span>
|
<span class="alert neutral version">{{ style.version }}</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue