DEV: Add loading spinner (#20)

* WIP: Add loading spinner

* DEV: Linting fixes

* DEV: Make `loading` a `@tracked` property
This commit is contained in:
Keegan George 2022-08-15 08:47:33 -07:00 committed by GitHub
parent 20bcb38249
commit be968d9158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -16,6 +16,7 @@ export default class SpreadsheetEditor extends Component {
@tracked showEditReason = false;
spreadsheet = null;
defaultColWidth = 150;
@tracked loading = null;
// Getters:
get isEditingTable() {
@ -92,9 +93,12 @@ export default class SpreadsheetEditor extends Component {
// Helper Methods:
loadLibraries() {
return loadScript(settings.theme_uploads_local.jsuites).then(() => {
return loadScript(settings.theme_uploads_local.jspreadsheet);
});
this.loading = true;
return loadScript(settings.theme_uploads_local.jsuites)
.then(() => {
return loadScript(settings.theme_uploads_local.jspreadsheet);
})
.finally(() => (this.loading = false));
}
buildNewTable() {

View File

@ -20,11 +20,13 @@
</div>
{{/if}}
<div
{{did-insert this.createSpreadsheet}}
tabindex="1"
class="jexcel_container"
></div>
<ConditionalLoadingSpinner @condition={{this.loading}}>
<div
{{did-insert this.createSpreadsheet}}
tabindex="1"
class="jexcel_container"
></div>
</ConditionalLoadingSpinner>
</DModalBody>
<div class="modal-footer">