From 3412e50b54e3daac8745234e21ab6e72be0ed165 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 04 Jun 2014 11:20:33 -0400
Subject: [PATCH] Fix attachment menu structure and aria-attributes

---
 program/js/app.js |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 1f6582b..b1feeb4 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3439,9 +3439,7 @@
     this.env.recipients_delimiter = this.env.recipients_separator + ' ';
 
     obj.keydown(function(e) { return ref.ksearch_keydown(e, this, props); })
-      .attr('autocomplete', 'off')
-      .attr('aria-autocomplete', 'list')
-      .attr('aria-expanded', 'false');
+      .attr({ 'autocomplete': 'off', 'aria-autocomplete': 'list', 'aria-expanded': 'false', 'role': 'combobox' });
   };
 
   this.submit_messageform = function(draft)
@@ -4586,9 +4584,9 @@
     }
 
     if (node) {
-      $(node).addClass('selected').removeAttr('aria-selected', 'true');
+      $(node).addClass('selected').attr('aria-selected', 'true');
       this.ksearch_selected = node._rcm_id;
-      $(this.ksearch_input).attr('aria-activedecendant', 'rcmkSearchItem' + this.ksearch_selected);
+      $(this.ksearch_input).attr('aria-activedescendant', 'rcmkSearchItem' + this.ksearch_selected);
     }
   };
 
@@ -4769,17 +4767,18 @@
     }
 
     if (ul.childNodes.length) {
-      this.ksearch_pane.show();
-      // select the first
-      if (!this.env.contacts.length) {
-        this.ksearch_select($('li:first', ul).get(0));
-      }
-
       // set the right aria-* attributes to the input field
       $(this.ksearch_input)
         .attr('aria-haspopup', 'true')
         .attr('aria-expanded', 'true')
-        .attr('aria-owns', 'rcmKSearchpane')
+        .attr('aria-owns', 'rcmKSearchpane');
+
+      this.ksearch_pane.show();
+
+      // select the first
+      if (!this.env.contacts.length) {
+        this.ksearch_select($('li:first', ul).get(0));
+      }
     }
 
     if (len)
@@ -4818,7 +4817,7 @@
     $(this.ksearch_input)
       .attr('aria-haspopup', 'false')
       .attr('aria-expanded', 'false')
-      .removeAttr('aria-activedecendant')
+      .removeAttr('aria-activedescendant')
       .removeAttr('aria-owns');
 
     this.ksearch_destroy();
@@ -6712,7 +6711,7 @@
         tr = document.createElement('tr');
 
         for (c=0, len=repl.length; c < len; c++) {
-          cell = document.createElement('td');
+          cell = document.createElement('th');
           cell.innerHTML = repl[c].html || '';
           if (repl[c].id) cell.id = repl[c].id;
           if (repl[c].className) cell.className = repl[c].className;

--
Gitblit v1.9.1