When a new search is submitted, reset and redraw the filters.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 2a3f471..8c4adf5 100644 (file)
@@ -408,6 +408,8 @@ function domReady ()
 // when search button pressed
 function onFormSubmitEventHandler()
 {
+    mkws.filters = []
+    redraw_navi();
     resetPage();
     loadSelect();
     triggerSearch();
@@ -449,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 });
 }
 
@@ -782,6 +784,18 @@ function defaultTemplate(name)
        </tr>\
       </table>\
 ';
+    } else if (name === "Summary") {
+       return '\
+      <a href="#" id="{{_id}}" onclick="{{_onclick}}">\
+       <b>{{md-title}}</b>\
+      </a>\
+      {{#if md-title-remainder}}\
+        <span>{{md-title-remainder}}</span>\
+      {{/if}}\
+      {{#if md-title-responsibility}}\
+       <span><i>{{md-title-responsibility}}</i></span>\
+      {{/if}}\
+';
     }
 
     var s = "There is no default '" + name +"' template!";