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

View File

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