-
- if ($(window).width() <= width &&
- parent.hasClass("mkwsTermlistContainer1")) {
- log("changing from wide to narrow: " + $(window).width());
- $(".mkwsTermlistContainer1").hide();
- $(".mkwsTermlistContainer2").show();
+ var targetWidth = 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");
+ } else if (width > targetWidth) {
+ log("already wide");
+ } else {
+ log("already narrow");
+ }
+ mkws.width = width;
+
+ if (width <= targetWidth &&
+ parent.hasClass("mkwsTermlist-Container-wide")) {
+ log("changing from wide to narrow: " + width);
+ $(".mkwsTermlist-Container-wide").hide();
+ $(".mkwsTermlist-Container-narrow").show();