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

Unified Diff: ui/file_manager/gallery/js/image_editor/image_editor.js

Issue 2400613002: Fix some accessibility issues in image editing. (Closed)
Patch Set: 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: ui/file_manager/gallery/js/image_editor/image_editor.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_editor.js b/ui/file_manager/gallery/js/image_editor/image_editor.js
index cee53ca437c8805a930ef30bb0aa69421cf6b3d7..c1397f18265a9e37e96b78ee9719d089f96e5db8 100644
--- a/ui/file_manager/gallery/js/image_editor/image_editor.js
+++ b/ui/file_manager/gallery/js/image_editor/image_editor.js
@@ -1142,7 +1142,14 @@ ImageEditor.Toolbar = function(
*/
this.updateCallback_ = opt_updateCallback || null;
- // Create action buttons.
+ /**
+ * @private {!HTMLElement}
+ */
+ this.container_ = /** @type {!HTMLElement} */ (document.createElement('div'));
+ this.container_.classList.add('container');
+ this.wrapper_.appendChild(this.container_);
+
+ // Create action buttons.
if (opt_showActionButtons) {
var actionButtonsLayer = document.createElement('div');
actionButtonsLayer.classList.add('action-buttons');
@@ -1159,13 +1166,6 @@ ImageEditor.Toolbar = function(
this.wrapper_.appendChild(actionButtonsLayer);
}
-
- /**
- * @private {!HTMLElement}
- */
- this.container_ = /** @type {!HTMLElement} */ (document.createElement('div'));
- this.container_.classList.add('container');
- this.wrapper_.appendChild(this.container_);
};
ImageEditor.Toolbar.prototype.__proto__ = cr.EventTarget.prototype;
@@ -1454,6 +1454,14 @@ ImageEditor.Toolbar.prototype.show = function(on) {
return; // Do not show empty toolbar;
this.wrapper_.hidden = !on;
+
+ // Focus the first input on the toolbar.
+ if (on) {
+ var input = this.container_.querySelector(
+ 'button, paper-button, input, paper-input, paper-slider');
+ if (input)
+ input.focus();
+ }
};
/** A prompt panel for the editor.

Powered by Google App Engine
This is Rietveld 408576698