Skip to content

Commit

Permalink
Added change selector handling for all remote inputs, selects, and
Browse files Browse the repository at this point in the history
textareas. Closes rails#199
  • Loading branch information
JangoSteve committed Sep 4, 2011
1 parent 8617245 commit 8939610
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rails.js
Expand Up @@ -52,7 +52,7 @@
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]',

// Select elements bound by jquery-ujs
selectChangeSelector: 'select[data-remote], input[type="checkbox"][data-remote]',
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',

// Form elements bound by jquery-ujs
formSubmitSelector: 'form',
Expand Down Expand Up @@ -114,7 +114,7 @@
data.push(button);
element.data('ujs:submit-button', null);
}
} else if (element.is('select') || element.is("input[type='checkbox']")) {
} else if (element.is(rails.inputChangeSelector)) {
method = element.data('method');
url = element.data('url');
data = element.serialize();
Expand Down Expand Up @@ -271,7 +271,7 @@
}
});

$(rails.selectChangeSelector).live('change.rails', function(e) {
$(rails.inputChangeSelector).live('change.rails', function(e) {
var link = $(this);
if (!rails.allowAction(link)) return rails.stopEverything(e);

Expand Down

0 comments on commit 8939610

Please sign in to comment.