Shopify/Timber — pull request #260 by humancopy (2014-10-28 12:56:31+00:00)
Title: Always trigger global listeners - add Shopify.onItemAdded & Shopify.onCa...

Hey ...

It's important to have these general listeners trigger to be able to easily customize the AJAX cart. The ```settings.onToggleCallback``` is not enough as it's called before the AJAX completes and can't be used to manipulate the cart. Currently to resolve this we have defined global AJAX listeners which check the request's URL to determine which action is happening (cart.js, add.js etc...)

With these cart listeners it will be much easier to add a loader, apply currency formatting or any other cart customization required.

I also added a default ```Shopify.onItemAdded``` and a new method ```Shopify.onCartOpen``` which is called after the AJAX request to open the cart completes.

Thanks :)