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

fixed responsive issue on minicart and search suggestion #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asad-rafter
Copy link
Contributor

No description provided.

const config = { childList: true, subtree: true };

const callback = function () {
if (targetNode.innerHTML.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please merge consecutive if statements

@@ -2,12 +2,18 @@

module.exports = function () {
// Custom Start: Make cart product images responsive //
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible that the minicart would be called twice, and we will create duplicate observers?
Maybe it makes sense to use a global DOM variable to skip a second call to the minicart

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only call once.

}
};

const observer = new MutationObserver(callback);
Copy link
Collaborator

Choose a reason for hiding this comment

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

MutationObserver - I like it!

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.

2 participants