From ca8479c3a7bda382d3fcac21b936091dd82f03cb Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 11 Apr 2014 11:56:20 +0100 Subject: [PATCH] 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. --- src/mkws-team.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 1.7.10.4