summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-05 15:46:28 +0100
committerByron Jones <bjones@mozilla.com>2014-03-05 15:46:28 +0100
commit5eb9280008f15e407d6c13374cb852e7f9ff9e87 (patch)
tree588e94c6d98aefb2f15667bfea04dc5e3460208b /js
parent82731c84210d42bdd66c6d5e4ec80cb26a44b1ae (diff)
downloadbugzilla-5eb9280008f15e407d6c13374cb852e7f9ff9e87.tar.gz
bugzilla-5eb9280008f15e407d6c13374cb852e7f9ff9e87.tar.xz
Bug 977137: Comment and Preview tabs need accessibility markup
Diffstat (limited to 'js')
-rw-r--r--js/field.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/js/field.js b/js/field.js
index 92eb50418..f3c96d8fe 100644
--- a/js/field.js
+++ b/js/field.js
@@ -864,16 +864,22 @@ function show_comment_preview(bug_id) {
var Dom = YAHOO.util.Dom;
var comment = document.getElementById('comment');
var preview = document.getElementById('comment_preview');
+
if (!comment || !preview) return;
if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')) return;
preview.style.width = (comment.clientWidth - 4) + 'px';
preview.style.height = comment.offsetHeight + 'px';
+ var comment_tab = document.getElementById('comment_tab');
Dom.addClass(comment, 'bz_default_hidden');
- Dom.removeClass('comment_tab', 'active_comment_tab');
+ Dom.removeClass(comment_tab, 'active_comment_tab');
+ comment_tab.setAttribute('aria-selected', 'false');
+
+ var preview_tab = document.getElementById('comment_preview_tab');
Dom.removeClass(preview, 'bz_default_hidden');
- Dom.addClass('comment_preview_tab', 'active_comment_tab');
+ Dom.addClass(preview_tab, 'active_comment_tab');
+ preview_tab.setAttribute('aria-selected', 'true');
Dom.addClass('comment_preview_error', 'bz_default_hidden');
@@ -924,8 +930,13 @@ function show_comment_edit() {
if (!comment || !preview) return;
if (YAHOO.util.Dom.hasClass(comment, 'active_comment_tab')) return;
+ var preview_tab = document.getElementById('comment_preview_tab');
YAHOO.util.Dom.addClass(preview, 'bz_default_hidden');
- YAHOO.util.Dom.removeClass('comment_preview_tab', 'active_comment_tab');
+ YAHOO.util.Dom.removeClass(preview_tab, 'active_comment_tab');
+ preview_tab.setAttribute('aria-selected', 'false');
+
+ var comment_tab = document.getElementById('comment_tab');
YAHOO.util.Dom.removeClass(comment, 'bz_default_hidden');
- YAHOO.util.Dom.addClass('comment_tab', 'active_comment_tab');
+ YAHOO.util.Dom.addClass(comment_tab, 'active_comment_tab');
+ comment_tab.setAttribute('aria-selected', 'true');
}