X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;fp=src%2Fmkws-core.js;h=69bd47d6f6d78b6256d53645d0c8829279112458;hb=51e09fd247ae34bcfb09d5f0f28e92c4bbeb4759;hp=c40a457178494b9da9fc94125e6cea967ff316ce;hpb=ec3e240c39a734b22c18eeee7344c7c2ed260673;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index c40a457..69bd47d 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -431,8 +431,13 @@ mkws.pagerNext = function(tname) { function makeWidgetsWithin(level, node) { node.find('[class^="mkws"],[class*=" mkws"]').each(function() { handleNodeWithTeam(this, function(tname, type) { - var oldHTML = this.innerHTML; var myTeam = mkws.teams[tname]; + if (!myTeam) { + myTeam = mkws.teams[tname] = team(j, tname); + log("Made MKWS team '" + tname + "'"); + } + + var oldHTML = this.innerHTML; var myWidget = widget(j, myTeam, type, this); myTeam.addWidget(myWidget); var newHTML = this.innerHTML; @@ -509,21 +514,10 @@ mkws.pagerNext = function(tname) { } } - // Find all nodes with an MKWS class, and determine their team from - // the mkwsTeam_* class. Make all team objects. var then = $.now(); - $('[class^="mkws"],[class*=" mkws"]').each(function() { - handleNodeWithTeam(this, function(tname, type) { - if (!mkws.teams[tname]) { - mkws.teams[tname] = team(j, tname); - log("Made MKWS team '" + tname + "'"); - } - }); - }); - makeWidgetsWithin(1, $(':root')); - var now = $.now(); + log("Walking MKWS nodes took " + (now-then) + " ms"); /*