lib/generators/rails_script/install/templates/base.js.coffee in rails_script-0.4.0 vs lib/generators/rails_script/install/templates/base.js.coffee in rails_script-0.4.1

- old
+ new

@@ -28,11 +28,11 @@ Clear event handlers with a blank namespace. This will prevent window and document event handlers from stacking when each new page is fetched. Adding a namespace to your events will prevent them from being removed between page loads, i.e. "$(window).on 'scroll.app', myHandler" ### setClearEventHandlers: -> - $(document).on 'page:before-change', -> + jQuery(document).on 'page:before-change', -> for element in [window, document] - for event, handlers of ($._data(element, 'events') || {}) + for event, handlers of (jQuery._data(element, 'events') || {}) for handler in handlers if handler? && handler.namespace == '' - $(element).off event, handler.handler + jQuery(element).off event, handler.handler