Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Using objects rather than arrays for TreeDropdownField ajax se…

…arch params, fixed selectors stuffed up in e385bbc
  • Loading branch information...
commit 4baef3b8923876e2a8b424f5ebf0bfc4ee22d336 1 parent c0fddf2
@chillu chillu authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 javascript/TreeDropdownField.js
View
10 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(
$('<input type="text" class="treedropdownfield-title search" />')
);
@@ -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;

0 comments on commit 4baef3b

Please sign in to comment.
Something went wrong with that request. Please try again.