Consolidate both narrow/wide clauses.
[mkws-moved-to-github.git] / src / mkws-core.js
index d5ce99b..e01b3e1 100644 (file)
@@ -332,18 +332,12 @@ mkws.pagerNext = function(tname) {
     function resizePage() {
        var list = ["mkwsSwitch", "mkwsLang"];
 
-       var targetWidth = mkws.config.responsive_design_width;
+       var threshhold = mkws.config.responsive_design_width;
         var width = $(window).width();
 
         if (mkws.width === undefined) {
             // No state change, since we have no previous state
-        } else if (mkws.width <= targetWidth && width > targetWidth) {
-            log("narrow -> wide");
-        } else if (mkws.width > targetWidth && width <= targetWidth) {
-            log("wide -> narrow");
-        }
-
-       if (mkws.width > targetWidth && width <= targetWidth) {
+        } else if (mkws.width > threshhold && width <= threshhold) {
            log("changing from wide to narrow: " + width);
            $(".mkwsTermlist-Container-wide").hide();
            $(".mkwsTermlist-Container-narrow").show();
@@ -354,7 +348,7 @@ mkws.pagerNext = function(tname) {
                    $("." + list[i] + ".mkwsTeam_" + tname).hide();
                }
            }
-        } else if (mkws.width <= targetWidth && width > targetWidth) {
+        } else if (mkws.width <= threshhold && width > threshhold) {
            log("changing from narrow to wide: " + width);
            $(".mkwsTermlist-Container-wide").show();
            $(".mkwsTermlist-Container-narrow").hide();