From 384c4603e2c4745fbebc7aa5731fd8d80d0a3111 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 24 Jan 2014 00:08:55 +0000 Subject: [PATCH] Do not recreate paz object if it already exists. --- tools/htdocs/mkws.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 1bf2137..67fb2fb 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -265,17 +265,19 @@ function _make_mkws_team($, teamName) { // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default - mkws.paz = new pz2({ "onshow": my_onshow, - "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way - "pazpar2path": mkws_config.pazpar2_url, - "oninit": my_oninit, - "onstat": my_onstat, - "onterm": my_onterm, - "termlist": "xtargets,subject,author", - "onbytarget": my_onbytarget, - "usesessions" : mkws_config.use_service_proxy ? false : true, - "showResponseType": '', // or "json" (for debugging?) - "onrecord": my_onrecord }); + if (!mkws.paz) { + mkws.paz = new pz2({ "onshow": my_onshow, + "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way + "pazpar2path": mkws_config.pazpar2_url, + "oninit": my_oninit, + "onstat": my_onstat, + "onterm": my_onterm, + "termlist": "xtargets,subject,author", + "onbytarget": my_onbytarget, + "usesessions" : mkws_config.use_service_proxy ? false : true, + "showResponseType": '', // or "json" (for debugging?) + "onrecord": my_onrecord }); + } if (!isNaN(parseInt(mkws_config.perpage_default))) { m_recPerPage = parseInt(mkws_config.perpage_default); -- 1.7.10.4