Skip to content

Commit f1f6f95

Browse files
committed
refactor(spinner): remove spinner display logic from message store and output modules
1 parent 00593ec commit f1f6f95

File tree

4 files changed

+2
-24
lines changed

4 files changed

+2
-24
lines changed

modules/core/js_modules/Hm_MessagesStore.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,6 @@ class Hm_MessagesStore {
256256
}
257257

258258
fetch(hideLoadingState = false) {
259-
// show my custom cypht spinner(class = cypht-spinner)
260-
const spinner = document.querySelector('.cypht-spinner');
261-
if (spinner) spinner.style.display = 'block';
262-
263259
let store = this;
264260
return this.getRequestConfigs().map((config) => {
265261
const initialConfig = Object.assign([], config);
@@ -277,9 +273,6 @@ class Hm_MessagesStore {
277273
undefined,
278274
reject
279275
);
280-
}).finally(() => {
281-
// Hide the spinner
282-
if (spinner) spinner.style.display = 'none';
283276
});
284277
});
285278
}

modules/core/output_modules.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,6 @@ protected function output() {
19011901
}
19021902
}
19031903
$res = '<div class="p-3">';
1904-
$res .= '<div class="cypht-spinner"><div class="spinner-border text-danger" role="status"><span class="visually-hidden">Loading...</span></div></div>';
19051904
$res .= '<table class="message_table table">';
19061905
if (!$this->get('no_message_list_headers')) {
19071906
if (!empty($col_flds)) {

modules/core/site.css

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,6 @@ td {
265265
.placeholder {
266266
width: 100px !important;
267267
}
268-
.cypht-spinner {
269-
position: absolute;
270-
inset-inline-start: 55%;
271-
top: 50%;
272-
--tw-translate-x: -50%;
273-
display: none;
274-
}
275-
276-
/* On small screens we don't have left menu, so there add 5% to inset-inline-start */
277-
@media screen and (max-width: 600px) {
278-
.cypht-spinner {
279-
inset-inline-start: 50%;
280-
}
281-
}
282268

283269
.logout {
284270
margin: 2px;

tests/phpunit/modules/core/output_modules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,10 @@ public function test_message_list_start() {
10471047
$test = new Output_Test('message_list_start', 'core');
10481048
$test->handler_response = array('message_list_fields' => array('foo', 'bar'));
10491049
$res = $test->run();
1050-
$this->assertEquals(array('<div class="p-3"><div class="cypht-spinner"><div class="spinner-border text-danger" role="status"><span class="visually-hidden">Loading...</span></div></div><table class="message_table table"><colgroup><col class="f"><col class="b"></colgroup><thead><tr><th class="o">o</th><th class="a">r</th></tr></thead><tbody class="message_table_body">'), $res->output_response);
1050+
$this->assertEquals(array('<div class="p-3"><table class="message_table table"><colgroup><col class="f"><col class="b"></colgroup><thead><tr><th class="o">o</th><th class="a">r</th></tr></thead><tbody class="message_table_body">'), $res->output_response);
10511051
$test->handler_response = array('message_list_fields' => array(array(false, true, false)));
10521052
$res = $test->run();
1053-
$this->assertEquals(array('<div class="p-3"><div class="cypht-spinner"><div class="spinner-border text-danger" role="status"><span class="visually-hidden">Loading...</span></div></div><table class="message_table table"><thead><tr><th></th></tr></thead><tbody class="message_table_body">'), $res->output_response);
1053+
$this->assertEquals(array('<div class="p-3"><table class="message_table table"><thead><tr><th></th></tr></thead><tbody class="message_table_body">'), $res->output_response);
10541054
}
10551055
/**
10561056
* @preserveGlobalState disabled

0 commit comments

Comments
 (0)