Reorder.
[mkws-moved-to-github.git] / src / mkws-core.js
index cc8c63f..c1cb1e4 100644 (file)
@@ -155,6 +155,46 @@ mkws.defaultMkwsConfig = function() {
 };
 
 
+// The following functions are dispatchers for team methods that
+// are called from the UI using a team-name rather than implicit
+// context.
+mkws.switchView = function(tname, view) {
+    mkws.teams[tname].switchView(view);
+};
+
+mkws.showDetails = function(tname, prefixRecId) {
+    mkws.teams[tname].showDetails(prefixRecId);
+};
+
+mkws.limitTarget  = function(tname, id, name) {
+    mkws.teams[tname].limitTarget(id, name);
+};
+
+mkws.limitQuery  = function(tname, field, value) {
+    mkws.teams[tname].limitQuery(field, value);
+};
+
+mkws.delimitTarget = function(tname, id) {
+    mkws.teams[tname].delimitTarget(id);
+};
+
+mkws.delimitQuery = function(tname, field, value) {
+    mkws.teams[tname].delimitQuery(field, value);
+};
+
+mkws.showPage = function(tname, pageNum) {
+    mkws.teams[tname].showPage(pageNum);
+};
+
+mkws.pagerPrev = function(tname) {
+    mkws.teams[tname].pagerPrev();
+};
+
+mkws.pagerNext = function(tname) {
+    mkws.teams[tname].pagerNext();
+};
+
+
 // wrapper to call team() after page load
 (function(j) {
     var log = mkws.log;
@@ -217,47 +257,6 @@ mkws.defaultMkwsConfig = function() {
     };
 
 
-    // The following functions are dispatchers for team methods that
-    // are called from the UI using a team-name rather than implicit
-    // context. Apart from mkws.log, they are the ONLY public UI to
-    // this module.
-    mkws.switchView = function(tname, view) {
-       mkws.teams[tname].switchView(view);
-    };
-
-    mkws.showDetails = function(tname, prefixRecId) {
-       mkws.teams[tname].showDetails(prefixRecId);
-    };
-
-    mkws.limitTarget  = function(tname, id, name) {
-       mkws.teams[tname].limitTarget(id, name);
-    };
-
-    mkws.limitQuery  = function(tname, field, value) {
-       mkws.teams[tname].limitQuery(field, value);
-    };
-
-    mkws.delimitTarget = function(tname, id) {
-       mkws.teams[tname].delimitTarget(id);
-    };
-
-    mkws.delimitQuery = function(tname, field, value) {
-       mkws.teams[tname].delimitQuery(field, value);
-    };
-
-    mkws.showPage = function(tname, pageNum) {
-       mkws.teams[tname].showPage(pageNum);
-    };
-
-    mkws.pagerPrev = function(tname) {
-       mkws.teams[tname].pagerPrev();
-    };
-
-    mkws.pagerNext = function(tname) {
-       mkws.teams[tname].pagerNext();
-    };
-
-
     /*
      * Run service-proxy authentication in background (after page load).
      * The username/password is configured in the apache config file
@@ -311,11 +310,6 @@ mkws.defaultMkwsConfig = function() {
     $(document).ready(function() {
        mkws.defaultMkwsConfig();
 
-       if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
-           log("Reset query width: " + mkws_config.query_width);
-           mkws_config.query_width = 50;
-       }
-
        for (var key in mkws_config) {
            if (mkws_config.hasOwnProperty(key)) {
                if (key.match(/^language_/)) {
@@ -327,6 +321,11 @@ mkws.defaultMkwsConfig = function() {
            }
        }
 
+       if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
+           log("Reset query width: " + mkws_config.query_width);
+           mkws_config.query_width = 50;
+       }
+
        if (mkws_config.responsive_design_width) {
            // Responsive web design - change layout on the fly based on
            // current screen width. Required for mobile devices.