Stupid JS doesn't have the ||= operator.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index cd0a18e..c17c097 100644 (file)
@@ -275,8 +275,9 @@ function team($, teamName) {
 
 
     // Finds the node of the specified class within the current team
-    function findnode(s) {
-        return $(s + '.mkwsTeam_' + m_teamName);
+    function findnode(selector, teamName) {
+       teamName = teamName || m_teamName;
+        return $(selector + '.mkwsTeam_' + m_teamName);
     }
 
 
@@ -822,7 +823,7 @@ function team($, teamName) {
            // Fall back to generic template if there is no team-specific one
            var node = findnode(".mkwsTemplate_" + name);
            if (!node.length) {
-               node = $(".mkwsTemplate_" + name + ".mkwsTeam_ALL");
+               node = findnode(".mkwsTemplate_" + name, "ALL");
            }
 
            var source = node.html();