Skip to content

Commit

Permalink
Updated to latest jquery-ujs
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed Apr 3, 2012
1 parent 1279d65 commit e95e737
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/jquery/rails/version.rb
Expand Up @@ -3,6 +3,6 @@ module Rails
VERSION = "2.0.1"
JQUERY_VERSION = "1.7.2"
JQUERY_UI_VERSION = "1.8.18"
JQUERY_UJS_VERSION = "82292010fb1743f038ab72b1f1e994e91be3eda3"
JQUERY_UJS_VERSION = "caabad7f7ba6c35de1588ea263295ed5bc166a43"
end
end
16 changes: 10 additions & 6 deletions vendor/assets/javascripts/jquery_ujs.js
Expand Up @@ -99,14 +99,18 @@
return $.ajax(options);
},

// Default way to get an element's href. May be overridden at $.rails.href.
href: function(element) {
return element.attr('href');
},

// Submits "remote" forms and links with ajax
handleRemote: function(element) {
var method, url, data,
crossDomain = element.data('cross-domain') || null,
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
options;
var method, url, data, crossDomain, dataType, options;

if (rails.fire(element, 'ajax:before')) {
crossDomain = element.data('cross-domain') || null;
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);

if (element.is('form')) {
method = element.attr('method');
Expand All @@ -125,7 +129,7 @@
if (element.data('params')) data = data + "&" + element.data('params');
} else {
method = element.data('method');
url = element.attr('href');
url = rails.href(element);
data = element.data('params') || null;
}

Expand Down Expand Up @@ -160,7 +164,7 @@
// Handles "data-method" on links such as:
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
handleMethod: function(link) {
var href = link.attr('href'),
var href = rails.href(link),
method = link.data('method'),
target = link.attr('target'),
csrf_token = $('meta[name=csrf-token]').attr('content'),
Expand Down

0 comments on commit e95e737

Please sign in to comment.