2

I saw a lot of events trigger('contentUpdated'). For example: vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js. My question is:

  • Where is the function contentUpdated?
  • Can anyone give me a brief description about it?
Raphael at Digital Pianism
70.8k37 gold badges192 silver badges357 bronze badges
asked Oct 10, 2016 at 16:27

1 Answer 1

3

contentUpdated is not a function, it is an event (similar to the load or click events).

This event is listened in lib/web/mage/mage.js :

$('body').on('contentUpdated', function () {
 if (mage) {
 mage.apply();
 }
});

It basically reinit the components inside a dynamic group of update elements.

answered Oct 10, 2016 at 16:31
1
  • @KhoaTruongDinh totally Commented Oct 10, 2016 at 16:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.