diff --git a/src/main/webapp/app/directives/keyboardActivateDirective.js b/src/main/webapp/app/directives/keyboardActivateDirective.js
new file mode 100644
index 0000000000..8d122dea75
--- /dev/null
+++ b/src/main/webapp/app/directives/keyboardActivateDirective.js
@@ -0,0 +1,34 @@
+vireo.directive('keyboardActivate', function() {
+ return {
+ restrict: 'A',
+ link: function($scope, element) {
+
+ // Anything exposed as role="button" must also respond to Enter and
+ // Space. Native buttons and links already do, so leave those alone
+ // rather than activating them twice.
+ var nativelyActivated = ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
+
+ if (nativelyActivated.indexOf(element[0].nodeName) > -1) {
+ return;
+ }
+
+ // Bound natively instead of with ng-keydown. ng-keydown would run
+ // inside a digest, and the click dispatched below starts its own,
+ // which would throw "$apply already in progress".
+ element.on('keydown', function(event) {
+
+ if (event.which !== 13 && event.which !== 32) {
+ return;
+ }
+
+ // Space would otherwise scroll the page.
+ event.preventDefault();
+
+ // A real click rather than the scope expression, so it bubbles
+ // to whichever element owns the ng-click. For some of the edit
+ // icons that is an ancestor, not the icon itself.
+ element[0].click();
+ });
+ }
+ };
+});
diff --git a/src/main/webapp/app/resources/styles/sass/app.scss b/src/main/webapp/app/resources/styles/sass/app.scss
index 1ba8ab43ed..2ac804a76a 100644
--- a/src/main/webapp/app/resources/styles/sass/app.scss
+++ b/src/main/webapp/app/resources/styles/sass/app.scss
@@ -672,6 +672,20 @@ h4 {
cursor: pointer;
}
+// Revealed on row hover, but kept in the layout rather than removed, so that it
+// stays focusable for keyboard users. Focus reveals it the same way hover does.
+.edit-setting-icon.edit-setting-icon-hidden {
+ opacity: 0;
+ pointer-events: none;
+}
+
+.edit-setting-icon:focus,
+.edit-setting-icon.edit-setting-icon-hidden:focus {
+ opacity: 1;
+ outline: 1px dotted;
+ pointer-events: auto;
+}
+
.td-center-middle {
text-align: center;
vertical-align: middle;
@@ -1649,12 +1663,19 @@ input[type=color]:focus {
cursor: pointer;
}
+// Hidden with opacity rather than visibility so the icon stays focusable; a
+// visibility: hidden element is dropped from the tab order entirely.
.email-workflow-rule-row span.glyphicon-pencil {
- visibility: hidden;
+ opacity: 0;
}
-.email-workflow-rule-row:hover span.glyphicon-pencil {
- visibility: visible;
+.email-workflow-rule-row:hover span.glyphicon-pencil,
+.email-workflow-rule-row span.glyphicon-pencil:focus {
+ opacity: 1;
+}
+
+.email-workflow-rule-row span.glyphicon-pencil:focus {
+ outline: 1px dotted;
}
.submission-review-item {
diff --git a/src/main/webapp/app/views/admin/settings/organization/emailWorkflowRule.html b/src/main/webapp/app/views/admin/settings/organization/emailWorkflowRule.html
index 8dadb43446..99dca12281 100644
--- a/src/main/webapp/app/views/admin/settings/organization/emailWorkflowRule.html
+++ b/src/main/webapp/app/views/admin/settings/organization/emailWorkflowRule.html
@@ -21,7 +21,7 @@
ng-repeat="rule in getSelectedOrganizationEmailWorkflowRules()"
class="email-workflow-rule-row">
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/dragAndDropCustomAction.html b/src/main/webapp/app/views/directives/dragAndDropCustomAction.html
index d74c9cf879..38533c781d 100644
--- a/src/main/webapp/app/views/directives/dragAndDropCustomAction.html
+++ b/src/main/webapp/app/views/directives/dragAndDropCustomAction.html
@@ -1,12 +1,18 @@
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/dragAndDropDegree.html b/src/main/webapp/app/views/directives/dragAndDropDegree.html
index 902adf8689..3ce018a4b4 100644
--- a/src/main/webapp/app/views/directives/dragAndDropDegree.html
+++ b/src/main/webapp/app/views/directives/dragAndDropDegree.html
@@ -1,5 +1,5 @@
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/dragAndDropDocumentType.html b/src/main/webapp/app/views/directives/dragAndDropDocumentType.html
index b2ff8a094b..3e4ac4dc41 100644
--- a/src/main/webapp/app/views/directives/dragAndDropDocumentType.html
+++ b/src/main/webapp/app/views/directives/dragAndDropDocumentType.html
@@ -4,5 +4,5 @@
{{item[property]}}
-
+
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/dragAndDropLanguage.html b/src/main/webapp/app/views/directives/dragAndDropLanguage.html
index 2ff9c304bd..0e0a626f9e 100644
--- a/src/main/webapp/app/views/directives/dragAndDropLanguage.html
+++ b/src/main/webapp/app/views/directives/dragAndDropLanguage.html
@@ -4,5 +4,5 @@
{{ item[property] }}
-
+
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/dragAndDropNote.html b/src/main/webapp/app/views/directives/dragAndDropNote.html
index b4889dc057..08e1215a1e 100644
--- a/src/main/webapp/app/views/directives/dragAndDropNote.html
+++ b/src/main/webapp/app/views/directives/dragAndDropNote.html
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/src/main/webapp/app/views/directives/lockingTextArea.html b/src/main/webapp/app/views/directives/lockingTextArea.html
index 7b0a509735..b01a41d2fd 100644
--- a/src/main/webapp/app/views/directives/lockingTextArea.html
+++ b/src/main/webapp/app/views/directives/lockingTextArea.html
@@ -7,7 +7,7 @@
{{ label }}
- This field is unlocked and may be edited. Leaving the editable area will save and re-lock the field.
+ This field is unlocked and may be edited. Leaving the editable area will save and re-lock the field.