Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show spinner till content isnt visible #210

Merged
merged 3 commits into from
Oct 12, 2020

Conversation

nightnei
Copy link
Contributor

@nightnei nightnei commented Oct 7, 2020

No description provided.

const hasText = !!targetNode.innerText.trim().length
const hasOpticNodes = !!targetNode.querySelector(':not(div):not(span)');
if (!hasText && !hasOpticNodes) return;
if (Object.values(status).some(n => !n)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use if with brackets pls

const hasText = !!targetNode.innerText.trim().length
const hasOpticNodes = !!targetNode.querySelector(':not(div):not(span)');
if (!hasText && !hasOpticNodes) return;
if (Object.values(status).some(n => !n)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found myself thinking that we probably do not have any polyfill for Object.values, so this would not work in IE11
So I suggest to test it in IE11 and change this by using supported methods or add polyfill for that if we still support IE11


// if we have rendered MS to DOM but temporary hide it for some reason, e.g. to fetch data
if (!status.isAnyChildVisible) {
status.isAnyChildVisible = Array.from(targetNode.children).some(node => node.style.display !== 'none');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE11 does not support Array.from

@nightnei nightnei merged commit 98199f2 into master Oct 12, 2020
@nightnei nightnei deleted the showSpinnerTillContentIsntVisible branch October 12, 2020 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants