-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodal_busy.svelte
50 lines (43 loc) · 1.05 KB
/
modal_busy.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<script>
// An uncancelable modal to show the user when something is happening and they need to wait.
// Updateable and optional shows a progress bar.
import Modal from './modal.svelte';
export let showProgressBar = false; // if true, show a progress bar
export let message = 'Please wait...';
let percentDone = 0;
export function Update({msg, percent})
{
if (msg != null)
message = msg;
if (percent != null)
percentDone = percent;
}
</script>
<Modal close={MODAL_OK}>
<h2>Please wait</h2>
<content>
{#if showProgressBar}
<span class="progressBarHolder">
<span class="progressBar" style="width:{percentDone}%"></span>
</span>
{/if}
<p>{message}</p>
</content>
</Modal>
<style>
span.progressBarHolder {
border:solid #88888888 1px;
margin:10px;
width:400px;
height:25px;
padding:0px;
display:inline-block;
}
span.progressBar {
display:inline-block;
margin:0px;
padding:0px;
background-color:#99dd99;
height:100%;
}
</style>