Browse Source

Show loading spinner until share settings are fully loaded

The inputs of the sharing settings are generated in a template in the
server, but the listeners to react to changes in the elements and save
the values in the server are loaded in the client once the DOM finishes
loading. If the DOM takes long to load the user can start to interact
with the settings before the listeners were set up and, therefore, the
changes would not be saved in the server. However, as the inputs are
modified the user would think that the changes were already saved.

To address that now when the sharing settings are open a loading spinner
is shown instead of the contents of the sharing settings, and only once
the listeners to save the changes were set up the spinner is removed and
the contents shown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
tags/v27.0.0beta2
Daniel Calviño Sánchez 1 year ago
parent
commit
b677d3e27d

+ 1
- 1
apps/settings/css/settings.css
File diff suppressed because it is too large
View File


+ 1
- 1
apps/settings/css/settings.css.map
File diff suppressed because it is too large
View File


+ 4
- 0
apps/settings/css/settings.scss View File

@@ -1129,6 +1129,10 @@ table.grid td.date {
}

#shareAPI {
&.loading > div {
display: none;
}

p {
padding-bottom: 0.8em;
}

+ 2
- 0
apps/settings/src/admin.js View File

@@ -286,4 +286,6 @@ window.addEventListener('DOMContentLoaded', () => {
if (document.getElementById('security-warning') !== null) {
setupChecks()
}

$('#shareAPI').removeClass('loading')
})

+ 1
- 1
apps/settings/templates/settings/admin/sharing.php View File

@@ -27,7 +27,7 @@

?>

<div class="section" id="shareAPI">
<div class="section loading" id="shareAPI">
<h2><?php p($l->t('Sharing'));?></h2>
<?php if ($_['sharingAppEnabled'] === false) { ?>
<p class="warning"><?php p($l->t('You need to enable the File sharing App.')); ?></p>

+ 2
- 2
dist/settings-legacy-admin.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/settings-legacy-admin.js.map
File diff suppressed because it is too large
View File


Loading…
Cancel
Save