Split onSelectDdChange into two separate functions, onSortChange and onPerpageChange.
authorMike Taylor <mike@indexdata.com>
Fri, 21 Mar 2014 11:00:06 +0000 (11:00 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 21 Mar 2014 11:00:06 +0000 (11:00 +0000)
Prepares the way for pub/sub widgetising those controls.

tools/htdocs/mkws.js

index bcbb403..32be2c7 100644 (file)
@@ -559,7 +559,17 @@ function team($, teamName) {
     }
 
 
-    function onSelectDdChange()
+    function onSortChange()
+    {
+       if (!m_submitted) return false;
+       resetPage();
+       loadSelect();
+       m_paz.show(0, m_perpage, m_sortOrder);
+       return false;
+    }
+
+
+    function onPerpageChange()
     {
        if (!m_submitted) return false;
        resetPage();
@@ -872,10 +882,10 @@ function team($, teamName) {
            node.submit(onFormSubmitEventHandler);
        node = findnode('.mkwsSort');
        if (node.length)
-           node.change(onSelectDdChange);
+           node.change(onSortChange);
        node = findnode('.mkwsPerpage');
        if (node.length)
-           node.change(onSelectDdChange);
+           node.change(onPerpageChange);
 
        // on first page, hide the termlist
        $(document).ready(function() { findnode(".mkwsTermlists").hide(); });