mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-14 18:18:14 +02:00
updated jsvm types and removed unused helper
This commit is contained in:
1 parent
1f6ab24b34
commit
866d38caf9
41 files changed
+3320
-3311
No files matched your search
@@ -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();
|
||||
}}
|
||||
/>
|
||||
Reference in new issue
Block a user