Permalink
Browse files

remove dependency on AjaxSolr.compact

  • Loading branch information...
1 parent dfcd3c2 commit 1c9f8db1c5885b9b234f58772b0f230a4adeceed @jpmckinney jpmckinney committed Apr 13, 2013
Showing with 20 additions and 8 deletions.
  1. +20 −8 core/ParameterStore.js
@@ -258,18 +258,24 @@ AjaxSolr.ParameterStore = AjaxSolr.Class.extend(
* </tt>. So, we need to choose another name for toString().</p>
*/
string: function () {
- var params = [];
+ var params = [], string;
for (var name in this.params) {
if (this.isMultiple(name)) {
for (var i = 0, l = this.params[name].length; i < l; i++) {
- params.push(this.params[name][i].string());
+ string = this.params[name][i].string();
+ if (string) {
+ params.push(string);
+ }
}
}
else {
- params.push(this.params[name].string());
+ string = this.params[name].string();
+ if (string) {
+ params.push(string);
+ }
}
}
- return AjaxSolr.compact(params).join('&');
+ return params.join('&');
},
/**
@@ -294,20 +300,26 @@ AjaxSolr.ParameterStore = AjaxSolr.Class.extend(
* @returns {String} A string representation of the exposed parameters.
*/
exposedString: function () {
- var params = [];
+ var params = [], string;
for (var i = 0, l = this.exposed.length; i < l; i++) {
if (this.params[this.exposed[i]] !== undefined) {
if (this.isMultiple(this.exposed[i])) {
for (var j = 0, m = this.params[this.exposed[i]].length; j < m; j++) {
- params.push(this.params[this.exposed[i]][j].string());
+ string = this.params[this.exposed[i]][j].string();
+ if (string) {
+ params.push(string);
+ }
}
}
else {
- params.push(this.params[this.exposed[i]].string());
+ string = this.params[this.exposed[i]].string();
+ if (string) {
+ params.push(string);
+ }
}
}
}
- return AjaxSolr.compact(params).join('&');
+ return params.join('&');
},
/**

0 comments on commit 1c9f8db

Please sign in to comment.