Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Much simpler method of checking if rails.js has already been loaded.

  • Loading branch information...
commit 049d2039da7188783408a22294982f01330d1b38 1 parent aab2251
@JangoSteve JangoSteve authored
Showing with 1 addition and 6 deletions.
  1. +1 −6 src/rails.js
View
7 src/rails.js
@@ -12,12 +12,7 @@
// Cut down on the number if issues from people inadvertently including jquery_ujs twice
// by detecting and raising an error when it happens.
- var alreadyInitialized = function() {
- var events = $._data(document, 'events');
- return events && events.click && $.grep(events.click, function(e) { return e.namespace === 'rails'; }).length;
- }
-
- if ( alreadyInitialized() ) {
+ if ( $.rails !== undefined ) {
$.error('jquery-ujs has already been loaded!');
}
Please sign in to comment.
Something went wrong with that request. Please try again.