fix: Remove status check when configuration was changed

Setting a null status was supposed to remove the status check, but
nothing was changed in that case. Now the status check is properly
removed, and doing that by hiding the element rather than just turning
it invisible also prevents that clicking on the invisible status
triggers a check, as until the new configuration is saved the check will
still be performed with the old configuration, which could be misleading
for the user.

Additionally, an explicit width is set to the parent of the span element
to prevent its width from changing when the span is shown and hidden.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2024-07-29 12:13:21 +02:00 committed by backportbot[bot]
parent 9e06254239
commit a0068126ee
2 changed files with 6 additions and 0 deletions

View file

@ -28,6 +28,8 @@
/* overwrite conflicting core styles */
display: table-cell;
vertical-align: middle;
/* ensure width does not change even if internal span is not displayed */
width: 43px;
}
#externalStorage td.status > span {

View file

@ -1316,6 +1316,7 @@ MountConfigListView.prototype = _.extend({
switch (status) {
case null:
// remove status
$statusSpan.hide();
break;
case StorageConfig.Status.IN_PROGRESS:
$statusSpan.attr('class', 'icon-loading-small');
@ -1329,6 +1330,9 @@ MountConfigListView.prototype = _.extend({
default:
$statusSpan.attr('class', 'error icon-error-white');
}
if (status !== null) {
$statusSpan.show();
}
if (typeof message === 'string') {
$statusSpan.attr('title', message);
}