[PATCH] [Wok] Issue #95: Accessibility

From: Gabriel Hidasy Rezende <ghidasy@br.ibm.com> Treat ESC and Enter keyboard events on Advanced Search dialog, Enter triggers a click on button-search, while esc closes the window. Gabriel Hidasy Rezende (1): Issue #95: Accessibility ui/js/wok.user-log.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.5.5

From: Gabriel Hidasy Rezende <ghidasy@br.ibm.com> Add event handlers for ESC and Enter at the Advanced Search dialog box. --- ui/js/wok.user-log.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js index 8c2b4a7..d5ffcc7 100644 --- a/ui/js/wok.user-log.js +++ b/ui/js/wok.user-log.js @@ -243,4 +243,13 @@ wok.initUserLogWindow = function() { }); $('#form-advanced-search').submit(); }); -}; \ No newline at end of file + + $(document).on('keyup', function(e) { + if (e.which == 27) { //ESC + wok.window.close(); + } + if (e.which == 13) { //Enter + $('#button-search').trigger('click'); + } + }); +}; -- 2.5.5

Please, add an appropriate commit message. "Accessibility" does not mean what this patch does. Isn't there a way to add those functions to the common dialog widget? That way all dialog will have the accessibility keys enabled. On 05/04/2016 11:54 AM, ghidasy@linux.vnet.ibm.com wrote:
From: Gabriel Hidasy Rezende <ghidasy@br.ibm.com>
Add event handlers for ESC and Enter at the Advanced Search dialog box. --- ui/js/wok.user-log.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js index 8c2b4a7..d5ffcc7 100644 --- a/ui/js/wok.user-log.js +++ b/ui/js/wok.user-log.js @@ -243,4 +243,13 @@ wok.initUserLogWindow = function() { }); $('#form-advanced-search').submit(); }); -}; \ No newline at end of file + + $(document).on('keyup', function(e) { + if (e.which == 27) { //ESC + wok.window.close(); + } + if (e.which == 13) { //Enter + $('#button-search').trigger('click'); + } + }); +};
participants (2)
-
Aline Manera
-
ghidasy@linux.vnet.ibm.com