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
Khoa Truong
32.5k11 gold badges91 silver badges159 bronze badges
1 Answer 1
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
Raphael at Digital Pianism
70.8k37 gold badges192 silver badges357 bronze badges
-
@KhoaTruongDinh totallyRaphael at Digital Pianism– Raphael at Digital Pianism2016年10月10日 16:41:04 +00:00Commented Oct 10, 2016 at 16:41
default