From 538493369b3df6bc6eaa7415bafc433ab21fbf2a Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 5 Feb 2018 13:57:24 -0800 Subject: [PATCH] adding button class on remote buttons --- sim/state/infrared.ts | 4 ++-- sim/visuals/controls/remoteBeaconButtons.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/state/infrared.ts b/sim/state/infrared.ts index 2ce8bd8d..7d4a0bd8 100644 --- a/sim/state/infrared.ts +++ b/sim/state/infrared.ts @@ -24,13 +24,13 @@ namespace pxsim { switch(this.state) { case InfraredRemoteButton.TopLeft: return 1; case InfraredRemoteButton.BottomLeft: return 2; - case InfraredRemoteButton.TopLeft: return 3; + case InfraredRemoteButton.TopRight: return 3; + case InfraredRemoteButton.CenterBeacon: return 9; case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 4; case InfraredRemoteButton.TopLeft | InfraredRemoteButton.TopRight: return 5; case InfraredRemoteButton.TopLeft | InfraredRemoteButton.BottomRight: return 6; case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopRight: return 7; case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.BottomRight: return 8; - case InfraredRemoteButton.CenterBeacon: return 9; case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopLeft: return 10; case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 11; default: return 0; diff --git a/sim/visuals/controls/remoteBeaconButtons.ts b/sim/visuals/controls/remoteBeaconButtons.ts index d547449c..89cd48c9 100644 --- a/sim/visuals/controls/remoteBeaconButtons.ts +++ b/sim/visuals/controls/remoteBeaconButtons.ts @@ -28,11 +28,11 @@ namespace pxsim.visuals { "bottomleft": InfraredRemoteButton.BottomLeft, "bottomright": InfraredRemoteButton.BottomRight } - + Object.keys(btns).forEach(bid => { const cid = btns[bid]; const bel = content.getElementById(pxsim.visuals.normalizeId(this.id, bid)); - bel.className += " sim-button"; + bel.setAttribute("class", "sim-button"); pointerEvents.down.forEach(evid => bel.addEventListener(evid, ev => { ev3board().remoteState.setPressed(cid, true); }));