Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
fix: error placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaveWPM committed Oct 4, 2023
1 parent e8ab492 commit 00d44e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/assets/maugallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Object.assign(_mauGalleryManager.mauGalleryGlobalConfig, {
modalTriggerClass: 'modal-trigger',
galleryItemClass: 'gallery-item',
modalWrapperClass: 'modal-component',
galleryPlaceHolderClass: 'gallery-placeholder',
galleryPlaceholderClass: 'gallery-placeholder',
styles: {
animation: {
modal: {
Expand Down Expand Up @@ -1077,8 +1077,8 @@ if (typeof _asyncMauGalleryLauncher === 'undefined') {

_mauGalleryManager.mauGalleriesConfig.forEach((conf) => {
new _mauGalleryManager.MauGallery(conf);
const galleryPlaceHolderClass = _mauGalleryManager.options('galleryPlaceHolderClass');
const placeholder = document.querySelector(`#${conf.galleryRootNodeId} .${galleryPlaceHolderClass}`);
const galleryPlaceholderClass = _mauGalleryManager.options('galleryPlaceholderClass');
const placeholder = document.querySelector(`#${conf.galleryRootNodeId} .${galleryPlaceholderClass}`);
if (placeholder) placeholder.remove();
});
}
11 changes: 6 additions & 5 deletions docs/assets/maugalleryLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ let _asyncMauGalleryLauncher = {
this.failedToLoadMauGalleryMsg = 'Failed to load MauGallery! Please, retry to load this page.';
this.boostrapIsAsyncLoadedSomewhereElseInMyCodebasePleaseDoNotAsyncLoadItHereImBeggingYou = false;
this.globalMauGalleryConfig = {
mauPrefixClass: 'mau'
mauPrefixClass: 'mau',
galleryPlaceholderClass: 'gallery-placeholder'
};

this.readyToMountGalleriesComponents = false;
Expand Down Expand Up @@ -43,8 +44,8 @@ let _asyncMauGalleryLauncher = {
clearInterval(coroutine);
launcherPtr.Launcher.mauGalleriesConfig.forEach((conf) => {
new _mauGalleryManager.MauGallery(conf);
const galleryPlaceHolderClass = _mauGalleryManager.options('galleryPlaceHolderClass');
const placeholder = document.querySelector(`#${conf.galleryRootNodeId} .${galleryPlaceHolderClass}`);
const galleryPlaceholderClass = _mauGalleryManager.options('galleryPlaceholderClass');
const placeholder = document.querySelector(`#${conf.galleryRootNodeId} .${galleryPlaceholderClass}`);
if (placeholder) placeholder.remove();
});
}
Expand Down Expand Up @@ -482,8 +483,8 @@ let _asyncMauGalleryLauncher = {
errorCallbacks: [
async function failedToInjectMauGallery() {
const mauPrefixClass = _asyncMauGalleryLauncher.Launcher.globalMauGalleryConfig.mauPrefixClass;
const galleryPlaceHolderClass = _asyncMauGalleryLauncher.Launcher.globalMauGalleryConfig.galleryPlaceHolderClass;
const placeholders = document.querySelectorAll(`.${mauPrefixClass}.${galleryPlaceHolderClass}`);
const galleryPlaceholderClass = _asyncMauGalleryLauncher.Launcher.globalMauGalleryConfig.galleryPlaceholderClass;
const placeholders = document.querySelectorAll(`.${mauPrefixClass}.${galleryPlaceholderClass}`);
placeholders.forEach(
(element) => (element.outerHTML = `<div class="mau gallery-placeholder alert alert-danger" role="alert">${_asyncMauGalleryLauncher.Launcher.failedToLoadMauGalleryMsg}</div>`)
);
Expand Down

0 comments on commit 00d44e7

Please sign in to comment.