Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5409)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js

Issue 2362673004: Aligns text to braille in chromevox. (Closed)
Patch Set: fixed test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
index a93365a55959d9d397e033bc80388b1dad1906a3..04bc3b21fcf39f90f3aae5a580001cd01ffcec60 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
@@ -44,10 +44,7 @@ Panel.init = function() {
this.searchInput_ = $('search');
/** @type {Element} @private */
- this.brailleTextElement_ = $('braille-text');
-
- /** @type {Element} @private */
- this.brailleCellsElement_ = $('braille-cells');
+ this.brailleTableElement_ = $('braille-table');
/**
* The array of top-level menus.
@@ -187,8 +184,19 @@ Panel.exec = function(command) {
this.speechElement_.innerHTML += escapeForHtml(command.data);
break;
case PanelCommandType.UPDATE_BRAILLE:
- this.brailleTextElement_.textContent = command.data.text;
- this.brailleCellsElement_.textContent = command.data.braille;
+ var groups = command.data.groups;
+ this.brailleTableElement_.deleteRow(0);
+ this.brailleTableElement_.deleteRow(0);
+ var row1 = this.brailleTableElement_.insertRow(-1);
+ var row2 = this.brailleTableElement_.insertRow(-1);
+
+ for (var i = 0; i < groups.length; i++) {
+ var topCell = row1.insertCell(-1);
+ var bottomCell = row2.insertCell(-1);
+ topCell.innerHTML = groups[i][0];
+ bottomCell.innerHTML = groups[i][1];
+ }
+
break;
case PanelCommandType.ENABLE_MENUS:
Panel.onEnableMenus();

Powered by Google App Engine
This is Rietveld 408576698