From: Mike Taylor Date: Wed, 16 Apr 2014 11:24:50 +0000 (+0100) Subject: Simplify findnode, which no longer needs to deal with commas. X-Git-Tag: 1.0.0~927 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=06ede116658fccf79fa2468d43d1a0b0449f5408;p=mkws-moved-to-github.git Simplify findnode, which no longer needs to deal with commas. --- diff --git a/src/mkws-team.js b/src/mkws-team.js index 1983508..683f11c 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -604,14 +604,12 @@ function team($, teamName) { function findnode(selector, teamName) { teamName = teamName || m_teamName; - selector = $.map(selector.split(','), function(s, i) { - if (teamName === 'AUTO') { - return (s + '.mkwsTeam_' + teamName + ',' + - s + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])'); - } else { - return s + '.mkwsTeam_' + teamName; - } - }).join(','); + if (teamName === 'AUTO') { + selector = (selector + '.mkwsTeam_' + teamName + ',' + + selector + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])'); + } else { + selector = selector + '.mkwsTeam_' + teamName; + } var node = $(selector); //log('findnode(' + selector + ') found ' + node.length + ' nodes');