Add tmp
[mkws-moved-to-github.git] / src / mkws-core.js
index 1ff2f2e..ec2b4a6 100644 (file)
@@ -336,11 +336,11 @@ mkws.pagerNext = function(tname) {
         var width = $(window).width();
         var from, to, method;
 
-        if (mkws.width === undefined) {
-            // No state change, since we have no previous state
-        } else if (mkws.width > threshhold && width <= threshhold) {
+        if ((mkws.width === undefined || mkws.width > threshhold) &&
+                   width <= threshhold) {
             from = "wide"; to = "narrow"; method = "hide";
-        } else if (mkws.width <= threshhold && width > threshhold) {
+        } else if ((mkws.width === undefined || mkws.width <= threshhold) &&
+                   width > threshhold) {
             from = "narrow"; to = "wide"; method = "show";
         }
         mkws.width = width;
@@ -350,10 +350,11 @@ mkws.pagerNext = function(tname) {
            $(".mkwsTermlist-Container-" + from).hide();
            $(".mkwsTermlist-Container-" + to).show();
            for (var tname in mkws.teams) {
-                mkws.teams[tname].queue("resize" + to).publish();
+                var team = mkws.teams[tname];
+                team.queue("resize" + to).publish();
                $(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlist-Container-" + to + ".mkwsTeam_" + tname));
                for(var i = 0; i < list.length; i++) {
-                    var widget = mkws.teams[tname].widget(list[i]);
+                    var widget = team.widget(list[i]);
                     if (widget) $(widget.node)[method]();
                }
            }