From b4fb2b4c0b2e3ea9d8b54a1d2e225e738063ccf6 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 14 Aug 2008 18:59:00 +0200 Subject: [PATCH] Can send additional parameters with the search command (connected to bug #2217) --- js/pz2.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/pz2.js b/js/pz2.js index 6bad626..4e2702f 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -237,7 +237,7 @@ pz2.prototype = } ); }, - search: function (query, num, sort, filter, showfrom) + search: function (query, num, sort, filter, showfrom, addParamsArr) { clearTimeout(this.statTimer); clearTimeout(this.showTimer); @@ -271,6 +271,14 @@ pz2.prototype = if (filter !== undefined) searchParams["filter"] = filter; + + // copy additional parmeters, do not overwrite + if (addParamsArr != undefined) { + for (var prop in addParamsArr) { + if (!searchParams.hasOwnProperty(prop)) + searchParams[prop] = addParamsArr[prop]; + } + } var context = this; var request = new pzHttpRequest(this.pz2String, this.errorHandler); -- 1.7.10.4