diff --git a/js/views-autocomplete-filters-dependent.js b/js/views-autocomplete-filters-dependent.js index c2a194b..80242cc 100644 --- a/js/views-autocomplete-filters-dependent.js +++ b/js/views-autocomplete-filters-dependent.js @@ -68,11 +68,28 @@ Drupal.jsAC.prototype.isDependent = function() { * Returns serialized input values from form except autocomplete input. */ Drupal.jsAC.prototype.serializeOuterForm = function() { - return $(this.input) + var i, temp, data = $(this.input) .parents('form:first') .find('select[name], textarea[name], input[name][type!=submit]') .not(this.input) - .serialize(); + .serializeArray(); + + // If we are in a Content Pane, we need to remove the parent 'exposed' from + // each of the controls, and ignore any controls that aren't in 'exposed'. + if (this.input.name.indexOf('exposed[') === 0) { + temp = []; + for (i = 0; i < data.length; i++) { + if (data[i].name.indexOf('exposed[') === 0) { + temp.push({ + name: data[i].name.substring(8, data[i].name.length - 1), + value: data[i].value + }); + } + } + data = temp; + } + + return $.param(data); }; })(jQuery); \ No newline at end of file