From 69a289ce2e52159de05336521dbfb22ca2c8ec4e Mon Sep 17 00:00:00 2001 From: microbit-mark Date: Wed, 8 Jan 2020 14:29:39 +0000 Subject: [PATCH 1/3] A11y: focus first button in webUSB mode --- python-main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-main.js b/python-main.js index c1f9bc6e..494516d9 100644 --- a/python-main.js +++ b/python-main.js @@ -590,7 +590,8 @@ function web_editor(config) { // Bind the ESCAPE key. $(document).keyup(function(e) { if (e.keyCode == 27) { // ESCAPE - $('#command-download').focus(); + $('#command-download').focus(); // Focus Download button or + $('#command-flash').focus(); // Focus Flash button in webUSB mode } }); // Bind drag and drop into editor. From 20636cce2130b449337a00b5357eb4f9838883f2 Mon Sep 17 00:00:00 2001 From: microbit-mark Date: Mon, 13 Jan 2020 16:06:02 +0000 Subject: [PATCH 2/3] A11y: focus first button --- python-main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python-main.js b/python-main.js index 494516d9..3a90333d 100644 --- a/python-main.js +++ b/python-main.js @@ -588,10 +588,16 @@ function web_editor(config) { } }); // Bind the ESCAPE key. + var button = $('#command-download'); + var otherButton = $('#command-flash'); $(document).keyup(function(e) { if (e.keyCode == 27) { // ESCAPE - $('#command-download').focus(); // Focus Download button or - $('#command-flash').focus(); // Focus Flash button in webUSB mode + if ( $('#command-download').is(':visible') ) { + $('#command-download').focus(); + } + else if ( $('#command-flash').is(':visible') ){ + $('#command-flash').focus(); + } } }); // Bind drag and drop into editor. From 75fe0fdc43f61e212dc0e66858c370245716625a Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 14 Jan 2020 15:18:06 +0000 Subject: [PATCH 3/3] remove unused vars --- python-main.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/python-main.js b/python-main.js index 3a90333d..e36e5808 100644 --- a/python-main.js +++ b/python-main.js @@ -588,8 +588,6 @@ function web_editor(config) { } }); // Bind the ESCAPE key. - var button = $('#command-download'); - var otherButton = $('#command-flash'); $(document).keyup(function(e) { if (e.keyCode == 27) { // ESCAPE if ( $('#command-download').is(':visible') ) {