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?
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.