summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-10-22 10:38:37 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-10-22 10:38:37 (GMT)
commit09488a745daec63efadddef18218561300177665 (patch)
tree45d3013f3a237a7becc10e37c3d38bdd17a384cf
parent9174727006085404bdabdd1684cd669dc713c111 (diff)
downloadkolab-chwala-09488a745daec63efadddef18218561300177665.tar.gz
Make dialog buttons focusable and key-pressable
-rw-r--r--public_html/js/files_ui.js9
-rw-r--r--public_html/skins/default/style.css7
2 files changed, 13 insertions, 3 deletions
diff --git a/public_html/js/files_ui.js b/public_html/js/files_ui.js
index e369546..592bca2 100644
--- a/public_html/js/files_ui.js
+++ b/public_html/js/files_ui.js
@@ -1886,10 +1886,17 @@ function files_ui()
if (footer.length) {
foot = $('<div class="_wModal_btns"></div>');
$.each(footer, function() {
- $('<div></div>').addClass('_wModal_btn_' + this.name).text(this.label).appendTo(foot);
+ $('<div tabindex="0"></div>').addClass('_wModal_btn_' + this.name).text(this.label).appendTo(foot)
});
body.append(foot);
+
+ // make buttons focusable and key-pressable
+ $(document).keydown(function(e) {
+ if (e.which == 13 && $(e.target).parent().is('._wModal_btns')) {
+ $(e.target).click();
+ }
+ });
}
// configure and display dialog
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index ab6ebe2..0a78506 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -1052,8 +1052,10 @@ fieldset.tabbed
color: #333;
}
-._wModal_btns div:hover {
+._wModal_btns div:hover,
+._wModal_btns div:focus {
background-color: #E6E6E6;
+ outline: none;
}
._wModal_btns div.default {
@@ -1063,7 +1065,8 @@ fieldset.tabbed
color: #FFF;
}
-._wModal_btns div.default:hover {
+._wModal_btns div.default:hover,
+._wModal_btns div.default:focus {
background-color: #0044CC
}