-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
fixed responsive issue on minicart and search suggestion #31
Conversation
const config = { childList: true, subtree: true }; | ||
|
||
const callback = function () { | ||
if (targetNode.innerHTML.length > 0) { |
There was a problem hiding this comment.
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 // |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MutationObserver - I like it!
No description provided.