File tree Expand file tree Collapse file tree 4 files changed +36
-13
lines changed
Expand file tree Collapse file tree 4 files changed +36
-13
lines changed Original file line number Diff line number Diff line change 5555 />{:else }<span class =" text"
5656 >{#if text .length === 0 }—{:else }{text }{/if }</span
5757 >{/if }
58- {#if saving }<Loading text = "" />{:else }<Button tip ="Save this edit" action ={save }
58+ {#if saving }<Loading />{:else }<Button tip ="Save this edit" action ={save }
5959 >{#if editing }✓{:else }✎{/if }</Button
6060 >{/if }
6161 </form >
Original file line number Diff line number Diff line change 66 text? : string ;
77 }
88
9- let { inline = true , text = ' Loading... ' }: Props = $props ();
9+ let { inline = true }: Props = $props ();
1010 </script >
1111
12- <div class:inline >
13- {text } <span class ="dots" >{Logo }</span >
14- </div >
12+ <div class:inline ><span class ="dots" >{Logo }</span ></div >
1513
1614<style >
1715 div {
3028
3129 .dots {
3230 display : inline-block ;
33- text-align : center ;
31+ text-align : baseline ;
3432 transform-origin : center ;
35- animation : spin 1s infinite linear ;
33+ animation : spin 1s infinite ease-in-out ;
3634 }
3735
3836 @keyframes spin {
39- from {
40- transform : rotate ( 0 deg );
37+ 0% {
38+ transform : translateX ( -0.5 em );
4139 }
42- to {
43- transform : rotate (360deg );
40+ 50% {
41+ transform : translateX (0.5em );
42+ }
43+ 100% {
44+ transform : translateX (-0.5em );
4445 }
4546 }
4647 </style >
Original file line number Diff line number Diff line change 118118 </div >
119119 {/if }
120120 {#if edit }<div class =" control" >
121- {#if saving }<Loading text = " " />
121+ {#if saving }<Loading />
122122 {:else }
123123 <Button
124124 tip ={editing ? ' Save your edits.' : ' Start editing this markup.' }
Original file line number Diff line number Diff line change 2424 import { invalidateAll } from ' $app/navigation' ;
2525 import { type OrganizationRow } from ' $database/Organization' ;
2626 import { navigating } from ' $app/state' ;
27+ import Loading from ' $lib/Loading.svelte' ;
2728
2829 let { data, children } = $props ();
2930
31+ let loading = $state (false );
32+
3033 const db = getDB ();
3134
3235 // Create a state to store the current organization. We'll store this as context.
5558 // When realtime reports revised data, and we aren't navigating, reload all data and render accordingly.
5659 function updateOrg() {
5760 if (navigating .to === null ) {
58- invalidateAll ();
61+ loading = true ;
62+ invalidateAll ().then (() => (loading = false ));
5963 }
6064 }
6165
7478 </script >
7579
7680{@render children ()}
81+ {#if loading }
82+ <div class =" banner" >
83+ <Loading />
84+ </div >
85+ {/if }
86+
87+ <style >
88+ .banner {
89+ position : fixed ;
90+ left : 0 ;
91+ right : 0 ;
92+ top : var (--spacing );
93+ display : flex ;
94+ flex-direction : row ;
95+ align-items : center ;
96+ justify-content : center ;
97+ }
98+ </style >
You can’t perform that action at this time.
0 commit comments