From 17e0cd65ddd7811b49b449c9009414e46036467f Mon Sep 17 00:00:00 2001 From: doug0102 Date: Sun, 19 Jul 2020 21:52:01 -0400 Subject: [PATCH 1/3] Made icons to expose/hide saved sessions and session controls accessible by keyboard --- src/css/style.css | 3 +++ src/js/history.js | 14 ++++++++++++++ src/js/historyItems.js | 1 + 3 files changed, 18 insertions(+) diff --git a/src/css/style.css b/src/css/style.css index e603d3b9..24817793 100755 --- a/src/css/style.css +++ b/src/css/style.css @@ -336,6 +336,9 @@ a.historyLink:hover { cursor: pointer; margin: 0 10px 0 -3px; } +.icon-minus-squared-alt ~ .groupLink { + visibility: visible; +} .sessionContents div:last-child { padding-bottom: 10px; } diff --git a/src/js/history.js b/src/js/history.js index 23c7e361..e6da9c89 100644 --- a/src/js/history.js +++ b/src/js/history.js @@ -120,6 +120,12 @@ element.onclick = func; } } + + function addKeyDownListenerToElement (element, func) { + if (element) { + element.onkeydown = func; + } + } function createSessionElement(session) { var sessionEl = historyItems.createSessionHtml(session, true); @@ -129,6 +135,14 @@ function() { toggleSession(sessionEl, session.sessionId); //async. unhandled promise } + ); + addKeyDownListenerToElement( + sessionEl.getElementsByClassName('sessionIcon')[0], + function(event) { + if(event.keyCode === 13) { + toggleSession(sessionEl, session.sessionId); //async. unhandled promise + } + } ); addClickListenerToElement( sessionEl.getElementsByClassName('sessionLink')[0], diff --git a/src/js/historyItems.js b/src/js/historyItems.js index 973a1c03..dccc6200 100644 --- a/src/js/historyItems.js +++ b/src/js/historyItems.js @@ -57,6 +57,7 @@ var historyItems = (function(global) { sessionIcon = createEl('i', { class: 'sessionIcon icon icon-plus-squared-alt', + tabindex: 0 }); sessionDiv = createEl('div', { From da9c8cd3d6ab6f3ed231472888e713b36e46d7d6 Mon Sep 17 00:00:00 2001 From: Shea Dougherty-Gill Date: Sun, 19 Jul 2020 22:02:39 -0400 Subject: [PATCH 2/3] fixed indentation --- src/js/history.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/history.js b/src/js/history.js index e6da9c89..72a84e2c 100644 --- a/src/js/history.js +++ b/src/js/history.js @@ -122,9 +122,9 @@ } function addKeyDownListenerToElement (element, func) { - if (element) { - element.onkeydown = func; - } + if (element) { + element.onkeydown = func; + } } function createSessionElement(session) { @@ -136,12 +136,12 @@ toggleSession(sessionEl, session.sessionId); //async. unhandled promise } ); - addKeyDownListenerToElement( + addKeyDownListenerToElement( sessionEl.getElementsByClassName('sessionIcon')[0], function(event) { - if(event.keyCode === 13) { - toggleSession(sessionEl, session.sessionId); //async. unhandled promise - } + if(event.keyCode === 13) { + toggleSession(sessionEl, session.sessionId); //async. unhandled promise + } } ); addClickListenerToElement( From 938763af29f1e5490d86673118b50bdc113b99ff Mon Sep 17 00:00:00 2001 From: Shea Dougherty-Gill Date: Sun, 19 Jul 2020 22:04:42 -0400 Subject: [PATCH 3/3] fixed indentation --- src/js/historyItems.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/historyItems.js b/src/js/historyItems.js index dccc6200..40ba0f7b 100644 --- a/src/js/historyItems.js +++ b/src/js/historyItems.js @@ -57,7 +57,7 @@ var historyItems = (function(global) { sessionIcon = createEl('i', { class: 'sessionIcon icon icon-plus-squared-alt', - tabindex: 0 + tabindex: 0 }); sessionDiv = createEl('div', {