Skip to content

Commit 3604dc5

Browse files
#25878 updated css classes names, added isLoading
1 parent 13ef913 commit 3604dc5

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

plugins/navigate/index.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,30 @@ import {
44
} from '../../common/plugin-element-cache.js';
55

66
const generateLoader = (pluginId) => {
7-
let loader = getCachedElement(`${pluginId}-loader`)?.element;
7+
let loader = getCachedElement(
8+
`${pluginId}-flotiq-singleton-plugin-loader`,
9+
)?.element;
810

911
if (!loader) {
1012
loader = document.createElement('div');
11-
loader.classList.add('loader-container');
12-
loader.innerHTML = '<div class="loader"></div>';
13+
loader.classList.add('flotiq-singleton-plugin-loader-container');
14+
loader.innerHTML = '<div class="flotiq-singleton-plugin-loader"></div>';
1315

14-
addElementToCache(loader, `${pluginId}-loader`);
16+
addElementToCache(loader, `${pluginId}-flotiq-singleton-plugin-loader`);
1517
}
1618

1719
return loader;
1820
};
1921

2022
export default function gridRenderHandler(
21-
{ contentType, contentObjects, isFetching },
23+
{ contentType, contentObjects, isFetching, isLoading },
2224
getPluginSettings,
2325
navigate,
2426
) {
25-
if (!getPluginSettings()) return;
27+
if (isLoading || isFetching) return generateLoader();
2628
const settings = JSON.parse(getPluginSettings());
2729

2830
if (!settings.singleton_types.includes(contentType?.name)) return;
29-
if (isFetching) return generateLoader();
3031

3132
const url = new URL(window.location.href);
3233

plugins/styles/style.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
.loader-container{
1+
.flotiq-singleton-plugin-loader-container{
22
width: 100%;
33
height: 100vh;
44
display: flex;
55
justify-content: center;
66
align-items: center;
77
}
88

9-
.loader{
10-
width: 35px;
11-
height: 35px;
12-
border: 3px solid #ccc;
13-
border-top: 3px solid #0083FC;
9+
.flotiq-singleton-plugin-loader{
10+
width: 50px;
11+
height: 50px;
12+
border: 5px solid #ccc;
13+
border-top: 5px solid #0083FC;
1414
border-radius: 50%;
1515
animation: spin 1s linear infinite;
1616
}

0 commit comments

Comments
 (0)