From 4baef3b8923876e2a8b424f5ebf0bfc4ee22d336 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 2 Jan 2012 22:38:13 +0100 Subject: [PATCH] BUGFIX Using objects rather than arrays for TreeDropdownField ajax search params, fixed selectors stuffed up in e385bbcb --- javascript/TreeDropdownField.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/javascript/TreeDropdownField.js b/javascript/TreeDropdownField.js index 9dcbd0144..e25c061e5 100644 --- a/javascript/TreeDropdownField.js +++ b/javascript/TreeDropdownField.js @@ -114,7 +114,7 @@ }, loadTree: function(params, callback) { var self = this, panel = this.getPanel(), treeHolder = $(panel).find('.tree-holder'); - var params = (params) ? this.getRequestParams().concat(params) : this.getRequestParams(); + var params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams(); panel.addClass('loading'); treeHolder.load(this.data('url-tree'), params, function(html, status, xhr) { var firstLoad = true; @@ -181,10 +181,10 @@ * This is useful to keep state like locale values which are typically * encoded in hidden fields through the form. * - * @return {array} + * @return {object} */ getRequestParams: function() { - return []; + return {}; } }); @@ -220,7 +220,7 @@ this._super(); var title = this.data('title'); - this.find('.title').replaceWith( + this.find('.treedropdownfield-title').replaceWith( $('') ); @@ -269,7 +269,7 @@ }, loadTree: function(params, callback) { var self = this, panel = this.getPanel(), treeHolder = $(panel).find('.tree-holder'); - var params = (params) ? this.getRequestParams().concat(params) : this.getRequestParams(); + var params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams(); panel.addClass('loading'); treeHolder.load(this.data('url-tree'), params, function(html, status, xhr) { var firstLoad = true;