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

Converted msrp_rwd.js to vanilla javascript #3214

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Converted msrp_rwd.js to vanilla javascript #3214

merged 1 commit into from
Apr 26, 2023

Conversation

fballiano
Copy link
Contributor

This is a small conversion from prototypejs to vanilla javascript, it affects a minor file: msrp_rwd.js

Manual testing scenarios

  1. enable RWD theme
  2. enable MSRP in configuration -> sales -> sales -> Minimum Advertised Price
  3. also enable "Apply MAP (Default Value)"
  4. flush caches
  5. go to frontend, browse do a product page
  6. price is hidden by default, if you click on these 2 links:

Screenshot 2023-04-24 alle 17 27 56

an overlay popup is shown with some info

@github-actions github-actions bot added the Template : rwd Relates to rwd template label Apr 24, 2023
@fballiano fballiano requested a review from luigifab April 25, 2023 14:21
@fballiano fballiano merged commit 2730ef7 into OpenMage:main Apr 26, 2023
@fballiano fballiano deleted the msrprwd branch April 26, 2023 20:01
@elidrissidev
Copy link
Member

Since helpBox and bodyNode are now an HTMLElement, the calls below to add and remove a class should be changed to element.classList.add() and element.classList.remove() respectively.

helpBox.removeClassName('map-popup-right');
helpBox.removeClassName('map-popup-left');
if (Element.getWidth(bodyNode) < event.pageX + (Element.getWidth(helpBox) / 2)) {
helpBox.addClassName('map-popup-left');
} else if (event.pageX - (Element.getWidth(helpBox) / 2) < 0) {
helpBox.addClassName('map-popup-right');
}
} else {
parent(event);
}

@fballiano
Copy link
Contributor Author

I tested the helpbox when I did the PR and it was working, I'm checkin it anyway

@fballiano
Copy link
Contributor Author

right, removeClassName and addClassName are from prototypejs, they still work but I'll change them in a few secs

@elidrissidev
Copy link
Member

Ahh ok, so prototype is adding those methods to native HTMLElements too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template : rwd Relates to rwd template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants