diff --git a/src/App.vue b/src/App.vue index 1b8746a..4441e9d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,6 @@ import PagedJsWrapper from './components/PagedJsWrapper.vue'; import EditorPanel from './components/editor/EditorPanel.vue'; import ElementPopup from './components/ElementPopup.vue'; -import PreviewLoader from './components/PreviewLoader.vue'; import { onMounted, ref, watch, computed, provide } from 'vue'; import { useStylesheetStore } from './stores/stylesheet'; import Coloris from '@melloware/coloris'; @@ -17,7 +16,7 @@ provide('activeTab', activeTab); let savedScrollPercentage = 0; const currentFrameIndex = ref(1); // 1 or 2, which iframe is currently visible -const isTransitioning = ref(false); +let isTransitioning = false; const activeFrame = computed(() => { return currentFrameIndex.value === 1 @@ -26,8 +25,8 @@ const activeFrame = computed(() => { }); const renderPreview = async (shouldReloadFromFile = false) => { - if (isTransitioning.value) return; - isTransitioning.value = true; + if (isTransitioning) return; + isTransitioning = true; // Determine which iframe is currently visible and which to render to const visibleFrame = @@ -36,7 +35,7 @@ const renderPreview = async (shouldReloadFromFile = false) => { currentFrameIndex.value === 1 ? previewFrame2.value : previewFrame1.value; if (!hiddenFrame) { - isTransitioning.value = false; + isTransitioning = false; return; } @@ -113,7 +112,7 @@ const renderPreview = async (shouldReloadFromFile = false) => { // Swap current frame currentFrameIndex.value = currentFrameIndex.value === 1 ? 2 : 1; - isTransitioning.value = false; + isTransitioning = false; }, 200); // Match CSS transition duration }, 50); // Small delay to ensure scroll is set }, 200); // Wait for PagedJS @@ -148,8 +147,6 @@ onMounted(() => renderPreview(true)); :class="{ shifted: activeTab.length > 0 }" > - - diff --git a/src/components/PreviewLoader.vue b/src/components/PreviewLoader.vue deleted file mode 100644 index cabc52b..0000000 --- a/src/components/PreviewLoader.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - -