From: Mike Taylor Date: Fri, 11 Apr 2014 10:56:20 +0000 (+0100) Subject: findnode now creates crazy-wacky complicated jQuery selectors to find X-Git-Tag: 1.0.0~972^2~2 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=ca8479c3a7bda382d3fcac21b936091dd82f03cb;p=mkws-moved-to-github.git findnode now creates crazy-wacky complicated jQuery selectors to find nodes that either belong to the specified team, or in the case that the team is "AUTO", no team at all. This makes it possible for us to avoid decorating nodes with mkwsTeam_AUTO classes. Down the line, we should be able to make this cleaner by having each class know what widgets it contains, so we don't need to do this findnode magic -- ideally so we don't need findnode at all. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index 9d9e34c..d6fc49f 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -604,7 +604,12 @@ function team($, teamName) { teamName = teamName || m_teamName; selector = $.map(selector.split(','), function(s, i) { - return s + '.mkwsTeam_' + teamName; + if (teamName === 'AUTO') { + return (s + '.mkwsTeam_' + teamName + ',' + + s + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])'); + } else { + return s + '.mkwsTeam_' + teamName; + } }).join(','); var node = $(selector);