Skip to content

Commit

Permalink
Merge pull request #1235 from josaphatim/fixed-spinner-sieve
Browse files Browse the repository at this point in the history
Always show spinner when copying/moving to mailbox
  • Loading branch information
marclaporte authored Sep 10, 2024
2 parents 7b87e36 + a495322 commit 6723ab2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 8 additions & 0 deletions modules/core/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,14 @@ var err_msg = function(msg) {
return "ERR"+hm_trans(msg);
};

var hm_spinner = function(type = 'border', size = '') {
return `<div class="d-flex justify-content-center spinner">
<div class="spinner-${type} text-dark${size ? ` spinner-${type}-${size}` : ''}" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>`
};

var fillImapData = function(details) {
$('#srv_setup_stepper_imap_address').val(details.server);
$('#srv_setup_stepper_imap_port').val(details.port);
Expand Down
7 changes: 1 addition & 6 deletions modules/sievefilters/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,11 +678,6 @@ $(function () {
' </td>' +
extra_options +
' <td class="col-sm-5">' +
' <div class="d-flex justify-content-center spinner d-none">' +
' <div class="spinner-border text-dark role="status">' +
' <span class="visually-hidden">Loading...</span>' +
' </div>' +
' </div>' +
' <input type="hidden" name="sieve_selected_action_value[]" value="">' +
' </input>' +
' <td class="col-sm-1 text-end align-middle">' +
Expand Down Expand Up @@ -779,7 +774,7 @@ $(function () {
}
if (selected_action.type === 'mailbox') {
let mailboxes = null;
tr_elem.children().find('.spinner').removeClass('d-none');
tr_elem.children().eq(2).html(hm_spinner());
Hm_Ajax.request(
[ {'name': 'hm_ajax_hook', 'value': 'ajax_sieve_get_mailboxes'},
{'name': 'imap_account', 'value': current_account} ],
Expand Down

0 comments on commit 6723ab2

Please sign in to comment.