-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make loading indicator more robust (#14)
* make loading indicator more robust * Update dry-shoes-prove.md
- Loading branch information
Showing
7 changed files
with
110 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro-vtbot": patch | ||
--- | ||
|
||
Makes the implementation of `<LoadingIndicator />` more robust and adds configuration options for image and position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
--- | ||
// just define javascript or typescript code for hide & show functions in the script below | ||
// Just define javascript or typescript code for hide & show functions | ||
// in the script below. | ||
// You also have to provide the HTML for the loading indicator. | ||
// Include it on your pages, preferable via a common layout | ||
// or - if it is simple - generate it dynamically in the `show` function. | ||
// If you have time consuming setup tasks, you should not run them in `show`. | ||
// It is better to move them to the optional `initializer` function, | ||
// which is executed shortly after a page has been loaded, | ||
// and not when the indicator is already to be displayed | ||
// You can generate the default loading indicator of the back of tricks | ||
// by calling `vtbotLoadingIndicator()`, preferably in the `initializer` function. | ||
--- | ||
|
||
<script> | ||
import { loading } from 'astro-vtbot/components/loading-indicator'; | ||
loading(show, hide); | ||
loading(show, hide, initializer); | ||
|
||
function show() { | ||
// show loading indicator | ||
} | ||
function hide() { | ||
// hide loading indicator | ||
} | ||
|
||
function initializer() { | ||
// this function is optional | ||
// remove the init parameter in the call to loading above if you do not need it | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters