X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=8c4adf51ee1825b345adc46c8dd7151dcc27d700;hb=6bdb4d7df78c7b1f2aebc1fc9ce198565528d4e1;hp=446fc7cac2ae8050218ef41256e4b791feb28c4a;hpb=b49693f0b2ab2724444e64f6167ee65cfbbd951a;p=mkws-moved-to-github.git
diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js
index 446fc7c..8c4adf5 100644
--- a/tools/htdocs/mkws.js
+++ b/tools/htdocs/mkws.js
@@ -267,6 +267,9 @@ function my_onshow(data) {
html.push('
',
renderSummary(hit),
'
');
+ if (hit.recid == curDetRecId) {
+ html.push(renderDetails(curDetRecData));
+ }
}
replaceHtml(results, html.join(''));
}
@@ -274,20 +277,13 @@ function my_onshow(data) {
function renderSummary(hit)
{
- var html = [];
- html.push(''
- + hit["md-title"] +' ');
- if (hit["md-title-remainder"] !== undefined) {
- html.push('' + hit["md-title-remainder"] + ' ');
- }
- if (hit["md-title-responsibility"] !== undefined) {
- html.push(''+hit["md-title-responsibility"]+'');
- }
- if (hit.recid == curDetRecId) {
- html.push(renderDetails(curDetRecData));
+ if (mkws.templateSummary === undefined) {
+ loadTemplate("Summary");
}
- return html.join('');
+
+ hit._id = "mkwsRec_" + hit.recid;
+ hit._onclick = "mkws.showDetails(this.id);return false;"
+ return mkws.templateSummary(hit);
}
@@ -412,6 +408,8 @@ function domReady ()
// when search button pressed
function onFormSubmitEventHandler()
{
+ mkws.filters = []
+ redraw_navi();
resetPage();
loadSelect();
triggerSearch();
@@ -453,7 +451,7 @@ function triggerSearch ()
}
}
- debug("triggerSearch: filters = " + JSON.stringify(mkws.filters) + ", pp2filter = " + pp2filter + ", pp2limit = " + pp2limit);
+ debug("triggerSearch(" + document.mkwsSearchForm.mkwsQuery.value + "): filters = " + JSON.stringify(mkws.filters) + ", pp2filter = " + pp2filter + ", pp2limit = " + pp2limit);
my_paz.search(document.mkwsSearchForm.mkwsQuery.value, recPerPage, curSort, pp2filter, undefined, { limit: pp2limit });
}
@@ -786,6 +784,18 @@ function defaultTemplate(name)
\
\
';
+ } else if (name === "Summary") {
+ return '\
+ \
+ {{md-title}}\
+ \
+ {{#if md-title-remainder}}\
+ {{md-title-remainder}}\
+ {{/if}}\
+ {{#if md-title-responsibility}}\
+ {{md-title-responsibility}}\
+ {{/if}}\
+';
}
var s = "There is no default '" + name +"' template!";