Remove outdated comment.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 0a0f632..98714ff 100644 (file)
@@ -72,7 +72,7 @@ Handlebars.registerHelper('index1', function(obj) {
 
 
 // Set up global mkws object. Contains truly global state such as SP
-// authentication, and a hash of team objects, indexed by windowid.
+// authentication, and a hash of team objects, indexed by team-name.
 //
 var mkws = {
     authenticated: false,
@@ -456,9 +456,7 @@ function team($, teamName) {
     }
 
 
-    // ### won't need to be externally visible once onFormSubmitEventHandler() is fixed.
-    // ### doesn't need windowid
-    function newSearch(query, sort, targets, windowid)
+    function newSearch(query, sort, targets)
     {
        debug("newSearch: " + query);
 
@@ -471,7 +469,7 @@ function team($, teamName) {
        redraw_navi();
        resetPage();
        loadSelect();
-       triggerSearch(query, sort, targets, windowid);
+       triggerSearch(query, sort, targets);
        switchView('records'); // In case it's configured to start off as hidden
        m_submitted = true;
     }
@@ -494,8 +492,7 @@ function team($, teamName) {
     }
 
 
-    // ### doesn't need windowid
-    function triggerSearch (query, sort, targets, windowid)
+    function triggerSearch (query, sort, targets)
     {
        var pp2filter = "";
        var pp2limit = "";
@@ -508,7 +505,6 @@ function team($, teamName) {
            m_sort = sort;
        }
        if (targets) {
-           // ### should support multiple |-separated targets
            m_filters.push({ id: targets, name: targets });
        }
 
@@ -534,9 +530,7 @@ function team($, teamName) {
        if (pp2limit) {
            params.limit = pp2limit;
        }
-       if (windowid) {
-           params.windowid = windowid;
-       }
+
        debug("triggerSearch(" + m_query + "): filters = " + $.toJSON(m_filters) + ", pp2filter = " + pp2filter + ", params = " + $.toJSON(params));
 
        // We can use: params.torusquery = "udb=NAME"
@@ -977,15 +971,6 @@ function team($, teamName) {
 
        mkws_html_switch();
 
-       // ### Should not be in the team code, since window size is global
-       if (mkws_config.responsive_design_width) {
-           // Responsive web design - change layout on the fly based on
-           // current screen width. Required for mobile devices.
-           $(window).resize(function(e) { mkws.resize_page() });
-           // initial check after page load
-           $(document).ready(function() { mkws.resize_page() });
-       }
-
        var node;
        node = findnode('.mkwsSearchForm');
        if (node.length)
@@ -1168,7 +1153,7 @@ function team($, teamName) {
        if (targets) s += " in targets '" + targets + "'";
        debug(s);
 
-       newSearch(query, sort, targets, m_teamName);
+       newSearch(query, sort, targets);
     }
 
 
@@ -1439,6 +1424,14 @@ function team($, teamName) {
            }
        }
 
+       if (mkws_config.responsive_design_width) {
+           // Responsive web design - change layout on the fly based on
+           // current screen width. Required for mobile devices.
+           $(window).resize(function(e) { mkws.resize_page() });
+           // initial check after page load
+           $(document).ready(function() { mkws.resize_page() });
+       }
+
        // Backwards compatibility: set new magic class names on any
        // elements that have the old magic IDs.
        var ids = [ "Switch", "Lang", "Search", "Pager", "Navi",