From 88529bc3395e74150cff94d2edd528ebff986612 Mon Sep 17 00:00:00 2001 From: Ben Creasy Date: Fri, 20 Feb 2015 14:02:47 -0800 Subject: [PATCH] Replace references to jQuery's 'bind' with 'on' --- documentation/coffee/fat_arrow.coffee | 2 +- documentation/index.html.js | 2 +- documentation/js/fat_arrow.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/coffee/fat_arrow.coffee b/documentation/coffee/fat_arrow.coffee index 836eb7a6..0c45d8f1 100644 --- a/documentation/coffee/fat_arrow.coffee +++ b/documentation/coffee/fat_arrow.coffee @@ -2,5 +2,5 @@ Account = (customer, cart) -> @customer = customer @cart = cart - $('.shopping_cart').bind 'click', (event) => + $('.shopping_cart').on 'click', (event) => @customer.purchase @cart \ No newline at end of file diff --git a/documentation/index.html.js b/documentation/index.html.js index 3747920d..7e08df2d 100644 --- a/documentation/index.html.js +++ b/documentation/index.html.js @@ -806,7 +806,7 @@ Expressions it to the current value of this, right on the spot. This is helpful when using callback-based libraries like Prototype or jQuery, for creating iterator functions to pass to each, or event-handler functions - to use with bind. Functions created with the fat arrow are able to access + to use with on. Functions created with the fat arrow are able to access properties of the this where they're defined.

<%= codeFor('fat_arrow') %> diff --git a/documentation/js/fat_arrow.js b/documentation/js/fat_arrow.js index 5a539863..b8b30432 100644 --- a/documentation/js/fat_arrow.js +++ b/documentation/js/fat_arrow.js @@ -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); };