updated jsvm types and removed unused helper

This commit is contained in:
Gani Georgiev
2023-10-14 19:14:18 +03:00
parent 1f6ab24b34
commit 866d38caf9
41 changed files with 3320 additions and 3311 deletions
+34
View File
@@ -0,0 +1,34 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import Dragline from "@/components/base/Dragline.svelte";
const widthStorageKey = "@adminSidebarWidth";
let classes = "";
export { classes as class }; // export reserved keyword
let sidebarElem;
let initialSidebarWidth;
let sidebarWidth = localStorage.getItem(widthStorageKey) || null;
$: if (sidebarWidth && sidebarElem) {
sidebarElem.style.width = sidebarWidth;
localStorage.setItem(widthStorageKey, sidebarWidth);
}
</script>
<aside bind:this={sidebarElem} class="page-sidebar {classes}">
<slot />
</aside>
<Dragline
on:dragstart={() => {
initialSidebarWidth = sidebarElem.offsetWidth;
}}
on:dragging={(e) => {
sidebarWidth = initialSidebarWidth + e.detail.diffX + "px";
}}
on:dragstop={() => {
CommonHelper.triggerResize();
}}
/>