generated from cms/tibi-docs
fixes
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { pages } from "../../store"
|
||||
import { pages, scrollToRowNr } from "../../store"
|
||||
import Homepage from "./Homepage.svelte"
|
||||
import Pagebuilder from "./Pagebuilder.svelte"
|
||||
import { apiBaseURL } from "../../../config"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
export let path
|
||||
export let homepage = false
|
||||
@@ -12,6 +13,27 @@
|
||||
page = $pages[path]
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if ($scrollToRowNr !== -1) {
|
||||
console.log("test321-", $scrollToRowNr)
|
||||
if (!$scrollToRowNr) {
|
||||
$scrollToRowNr = -1
|
||||
return
|
||||
}
|
||||
let element = document.getElementById("row-" + $scrollToRowNr)
|
||||
console.log(element)
|
||||
if (!element) {
|
||||
$scrollToRowNr = -1
|
||||
return
|
||||
}
|
||||
|
||||
element?.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
})
|
||||
$scrollToRowNr = -1
|
||||
}
|
||||
})
|
||||
|
||||
$: {
|
||||
if (Object.keys($pages).length) {
|
||||
initPage()
|
||||
@@ -22,8 +44,8 @@
|
||||
<div class="rows" class:HP="{path == '/'}">
|
||||
{#if page}
|
||||
{#if path == "/"}<Homepage />{/if}
|
||||
{#each page.rows as row}
|
||||
<div class="row">
|
||||
{#each page.rows as row, i}
|
||||
<div class="row" id="row-{i}">
|
||||
{#if row.row.backgroundImage}
|
||||
<div class="background-image">
|
||||
<img src="{`${apiBaseURL}page/${page.id}/${row.row.backgroundImage?.src}`}" alt="img" />
|
||||
@@ -52,7 +74,10 @@
|
||||
|
||||
& > .row {
|
||||
padding: 10px;
|
||||
padding-top: 80px;
|
||||
padding-top: 30px;
|
||||
@media @tablet {
|
||||
padding-top: 80px;
|
||||
}
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user