diff --git a/html/controls/mobile.css b/html/controls/mobile.css index ca6cb5740..8144187cb 100644 --- a/html/controls/mobile.css +++ b/html/controls/mobile.css @@ -15,8 +15,8 @@ /* END ClockBubbles */ /* Alternate Names */ - .HasAlternateName>.Name { display: none; } - :not(.HasAlternateName)>.AlternateName { display: none; } + .Name.HasAlternateName { display: none; } + .AlternateName:not(.HasAlternateName) { display: none; } /* END Alternate Names */ diff --git a/html/controls/mobile.js b/html/controls/mobile.js index eb03469d1..e6e78d104 100644 --- a/html/controls/mobile.js +++ b/html/controls/mobile.js @@ -18,8 +18,12 @@ $sb(function() { setupPenaltyTimePage(); $.each( [ "1", "2" ], function(i, t) { - $sb("ScoreBoard.Team("+t+").AlternateName(mobile).Name").$sbBindAndRun("sbchange", function(event, val) { - $(".Team"+t+".AlternateName").parent().toggleClass("HasAlternateName", val != ""); + $sb("ScoreBoard.Team("+t+")").$sbBindAddRemoveEach("AlternateName", function(event, node) { + if ($sb(node).$sbId == "mobile") + $sb(node).$sb("Name").$sbBindAndRun("sbchange", function(event2, val) { + $(".Team"+t+".Name,.Team"+t+".AlternateName") + .toggleClass("HasAlternateName", $.trim(val) != ""); + }); }); }); });