Part of ACREP-80: new 'widget' parameter to team.newSearch
authorMike Taylor <mike@indexdata.com>
Tue, 6 Oct 2015 14:41:38 +0000 (15:41 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 6 Oct 2015 14:41:38 +0000 (15:41 +0100)
src/mkws-team.js
src/mkws-widget-main.js
src/mkws-widget.js

index c26d2c3..3d48385 100644 (file)
@@ -288,7 +288,7 @@ mkws.makeTeam = function($, teamName) {
   that.resetPage = resetPage;
 
 
-  function newSearch(query, sortOrder, maxrecs, perpage, limit, targets, torusquery) {
+  function newSearch(widget, query, sortOrder, maxrecs, perpage, limit, targets, torusquery) {
     that.info("newSearch: " + query);
 
     if (config.use_service_proxy && !mkws.authenticated) {
index b218a95..2d47617 100644 (file)
@@ -288,7 +288,7 @@ mkws.registerWidgetType('search-form', function() {
   var team = this.team;
   this.node.submit(function() {
     var val = team.widget('query').value();
-    team.newSearch(val);
+    team.newSearch(this, val);
     return false;
   });
 });
index 4cace29..cb5708a 100644 (file)
@@ -131,7 +131,7 @@ mkws.makeWidget = function($, team, type, node) {
         if (targetfilter) s += " constrained by targetfilter '" + targetfilter + "'";
         that.info(s);
 
-        that.team.newSearch(query, sortOrder, maxrecs, perpage, limit, targets, targetfilter);
+        that.team.newSearch(that, query, sortOrder, maxrecs, perpage, limit, targets, targetfilter);
       });
     }
   };