Merge the two(!) definitions of Results widget.
[mkws-moved-to-github.git] / src / mkws-widget-main.js
index e7bacd7..9bb08eb 100644 (file)
@@ -117,13 +117,6 @@ mkws.registerWidgetType('Pager', function() {
 });
 
 
-mkws.registerWidgetType('Results', function() {
-    // Nothing to do apart from act as an autosearch trigger
-    // Contained elements do all the real work
-    widget.autosearch(this);
-});
-
-
 mkws.registerWidgetType('Records', function() {
     var that = this;
     var team = this.team;
@@ -228,6 +221,7 @@ mkws.registerWidgetType('Switch', function() {
 <a href="#" onclick="mkws.switchView(\'' + tname + '\', \'records\')">Records</a><span> \
 | \
 </span><a href="#" onclick="mkws.switchView(\'' + tname + '\', \'targets\')">Targets</a>');
+    widget.hideWhenNarrow(this);
 });
 
 
@@ -275,6 +269,8 @@ mkws.registerWidgetType('Results', function() {
     </td>\
   </tr>\
 </table>');
+
+    widget.autosearch(this);
 });
 
 
@@ -381,6 +377,7 @@ mkws.registerWidgetType('Lang', function() {
     }
 
     $(this.node).html(data);
+    widget.hideWhenNarrow(this);
 
 
     // set or re-set "lang" URL parameter