Permalink
Browse files

Added change selector handling for all remote inputs, selects, and

textareas. Closes #199
  • Loading branch information...
1 parent 8617245 commit 89396108ce574080f9b877cad74573c5d1ae9aa2 @JangoSteve JangoSteve committed Sep 4, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/rails.js
View
6 src/rails.js
@@ -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',
@@ -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();
@@ -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);

0 comments on commit 8939610

Please sign in to comment.