Part of MKWS-64.
authorMike Taylor <mike@indexdata.com>
Sat, 2 May 2015 19:06:33 +0000 (20:06 +0100)
committerMike Taylor <mike@indexdata.com>
Sat, 2 May 2015 19:06:33 +0000 (20:06 +0100)
When a sort-criterion is selected, update the URL (though the wonder
of assigning to window.location.href) rather then changing state
directly.

src/mkws-widget-main.js

index cd08b2b..509939f 100644 (file)
@@ -217,10 +217,7 @@ mkws.registerWidgetType('sort', function() {
   var that = this;
 
   this.node.change(function() {
-    that.team.set_sortOrder(that.node.val());
-    if (that.team.submitted()) {
-      that.team.reShow();
-    }
+    window.location.href = '#' + that.team.urlFragment({ sort: that.node.val() });
     return false;
   });
 });