summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web/bug_modal.js
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2017-01-27 15:33:40 +0100
committerDavid Lawrence <dkl@mozilla.com>2017-01-27 15:35:54 +0100
commit2fcef7a5b1aefef32a1a2b524604140e1872b192 (patch)
tree41597fa70c868be7c6b126f5dfedcbc54b3e98f7 /extensions/BugModal/web/bug_modal.js
parent6cadcc129e33b09346f4b698d548fa8668af228d (diff)
downloadbugzilla-2fcef7a5b1aefef32a1a2b524604140e1872b192.tar.gz
bugzilla-2fcef7a5b1aefef32a1a2b524604140e1872b192.tar.xz
Revert "Bug 1280397 - [a11y] Make the component, product, and other latches accessible"
Diffstat (limited to 'extensions/BugModal/web/bug_modal.js')
-rw-r--r--extensions/BugModal/web/bug_modal.js81
1 files changed, 25 insertions, 56 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index 40d3cd6dd..01be1fd2c 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -163,38 +163,20 @@ $(function() {
// product/component info
$('.spin-toggle, #product-latch, #component-latch')
.click(function(event) {
- spin_toggle(event);
- }).keydown(function(event) {
- // allow space or enter to toggle visibility
- if (event.keyCode == 13 || event.keyCode == 32) {
- spin_toggle(event);
+ event.preventDefault();
+ var latch = $($(event.target).data('latch'));
+ var el_for = $($(event.target).data('for'));
+
+ if (latch.data('expanded')) {
+ latch.data('expanded', false).html('&#9656;');
+ el_for.hide();
+ }
+ else {
+ latch.data('expanded', true).html('&#9662;');
+ el_for.show();
}
});
- function spin_toggle(event) {
- event.preventDefault();
- var type = $(event.target).data('for');
- var latch = $('#' + type + '-latch');
- var name = $('#' + type + '-name');
- var info = $('#' + type + '-info');
- var label = name.attr('aria-label');
-
- if (latch.data('expanded')) {
- label = label.replace(/^hide/, 'show');
- latch.data('expanded', false).html('&#9656;');
- name.attr('aria-expanded', false);
- info.hide();
- }
- else {
- label = label.replace(/^show/, 'hide');
- latch.data('expanded', true).html('&#9662;');
- name.attr('aria-expanded', true);
- info.show();
- }
- name.attr('aria-label', label);
- name.attr('title', label);
- }
-
// cc list
function ccListLoading() {
@@ -248,37 +230,24 @@ $(function() {
$('#cc-summary').addClass('cc-loadable');
$('#cc-latch, #cc-summary')
.click(function(event) {
- cc_toggle(event);
- }).keydown(function(event) {
- // allow space or enter to toggle visibility
- if (event.keyCode == 13 || event.keyCode == 32) {
- cc_toggle(event);
+ event.preventDefault();
+ var latch = $('#cc-latch');
+
+ if (latch.data('expanded')) {
+ latch.data('expanded', false).html('&#9656;');
+ $('#cc-list').hide();
+ }
+ else {
+ latch.data('expanded', true).html('&#9662;');
+ $('#cc-list').show();
+ if (!latch.data('fetched')) {
+ ccListLoading();
+ ccListUpdate();
+ }
}
});
}
- function cc_toggle(event) {
- event.preventDefault();
- var latch = $('#cc-latch');
- var label = latch.attr('aria-label');
- if (latch.data('expanded')) {
- label = label.replace(/^hide/, 'show');
- latch.data('expanded', false).html('&#9656;');
- $('#cc-list').hide();
- }
- else {
- latch.data('expanded', true).html('&#9662;');
- label = label.replace(/^show/, 'hide');
- $('#cc-list').show();
- if (!latch.data('fetched')) {
- ccListLoading();
- ccListUpdate();
- }
- }
- latch.attr('aria-label', label);
- $('#cc-summary').attr('aria-label', label);
- }
-
// copy summary to clipboard
function clipboardSummary() {