Merge pull request #3871 from jcrben/doc_tweak

Replace references to jQuery's 'bind' with 'on'
This commit is contained in:
Jeremy Ashkenas 2015-02-20 17:16:32 -05:00
commit 8f5c77c3ce
3 changed files with 3 additions and 3 deletions

View File

@ -2,5 +2,5 @@ Account = (customer, cart) ->
@customer = customer
@cart = cart
$('.shopping_cart').bind 'click', (event) =>
$('.shopping_cart').on 'click', (event) =>
@customer.purchase @cart

View File

@ -806,7 +806,7 @@ Expressions
it to the current value of <tt>this</tt>, right on the spot. This is helpful
when using callback-based libraries like Prototype or jQuery, for creating
iterator functions to pass to <tt>each</tt>, or event-handler functions
to use with <tt>bind</tt>. Functions created with the fat arrow are able to access
to use with <tt>on</tt>. Functions created with the fat arrow are able to access
properties of the <tt>this</tt> where they're defined.
</p>
<%= codeFor('fat_arrow') %>

View File

@ -4,7 +4,7 @@ var Account;
Account = function(customer, cart) {
this.customer = customer;
this.cart = cart;
return $('.shopping_cart').bind('click', (function(_this) {
return $('.shopping_cart').on('click', (function(_this) {
return function(event) {
return _this.customer.purchase(_this.cart);
};