X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=0af84a93d94935e69a0a7bfd2f9b1aa310f242b4;hb=82b78674032447e08477c34258c999fea92cbadc;hp=75c196e48c81c6805852bce7f0507a2725afaff4;hpb=e1842f3ced89b3155f5918c896b902717a26e619;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index 75c196e..0af84a9 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -364,11 +364,11 @@ mkws.pagerNext = function(tname) { var w1 = team.widget(t + "-Container-" + from); var w2 = team.widget(t + "-Container-" + to); if (w1) { - w1.jqnode.hide(); + w1.node.hide(); } if (w2) { - w2.jqnode.show(); - w.jqnode.appendTo(w2.jqnode); + w2.node.show(); + w.node.appendTo(w2.node); } }); team.queue("resize-" + to).publish(); @@ -430,7 +430,7 @@ mkws.pagerNext = function(tname) { function selectorForAllWidgets() { - if (mkws.config.scan_all_nodes) { + if (mkws.config && mkws.config.scan_all_nodes) { // This is the old version, which works by telling jQuery to // find every node that has a class beginning with "mkws". In // theory it should be slower than the class-based selector; but @@ -479,7 +479,8 @@ mkws.pagerNext = function(tname) { } - $(document).ready(function() { + function init(rootsel) { + if (!rootsel) var rootsel = ':root'; var saved_config; if (typeof mkws_config === 'undefined') { log("setting empty config"); @@ -544,7 +545,7 @@ mkws.pagerNext = function(tname) { } var then = $.now(); - makeWidgetsWithin(1, $(':root')); + makeWidgetsWithin(1, $(rootsel)); var now = $.now(); log("walking MKWS nodes took " + (now-then) + " ms"); @@ -567,5 +568,9 @@ mkws.pagerNext = function(tname) { // raw pp2 runAutoSearches(); } + }; + $(document).ready(function() { + var widgetSelector = selectorForAllWidgets(); + if (widgetSelector && $(widgetSelector).length !== 0) init(); }); })(jQuery);