resizePage() publishes "resize-narrow" and "resize-wide" events.
authorMike Taylor <mike@indexdata.com>
Wed, 30 Apr 2014 15:35:05 +0000 (16:35 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 30 Apr 2014 15:35:05 +0000 (16:35 +0100)
This will allow individual widgets to respond to size-changes.

src/mkws-core.js

index 5ca8187..4a48c48 100644 (file)
@@ -341,6 +341,7 @@ mkws.pagerNext = function(tname) {
            $(".mkwsTermlist-Container-wide").hide();
            $(".mkwsTermlist-Container-narrow").show();
            for (var tname in mkws.teams) {
+                mkws.teams[tname].queue("resize-narrow").publish();
                $(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlist-Container-narrow.mkwsTeam_" + tname));
                for(var i = 0; i < list.length; i++) {
                    $("." + list[i] + ".mkwsTeam_" + tname).hide();
@@ -352,6 +353,7 @@ mkws.pagerNext = function(tname) {
            $(".mkwsTermlist-Container-wide").show();
            $(".mkwsTermlist-Container-narrow").hide();
            for (var tname in mkws.teams) {
+                mkws.teams[tname].queue("resize-wide").publish();
                $(".mkwsTermlists.mkwsTeam_" + tname).appendTo($(".mkwsTermlist-Container-wide.mkwsTeam_" + tname));
                for(var i = 0; i < list.length; i++) {
                    $("." + list[i] + ".mkwsTeam_" + tname).show();