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

Side by Side Diff: ui/file_manager/gallery/js/image_editor/image_transform.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Crop mode. 6 * Crop mode.
7 * 7 *
8 * @extends {ImageEditor.Mode} 8 * @extends {ImageEditor.Mode}
9 * @constructor 9 * @constructor
10 * @struct 10 * @struct
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * @override 136 * @override
137 */ 137 */
138 ImageEditor.Mode.Crop.prototype.createTools = function(toolbar) { 138 ImageEditor.Mode.Crop.prototype.createTools = function(toolbar) {
139 var aspects = { 139 var aspects = {
140 GALLERY_ASPECT_RATIO_1_1: 1 / 1, 140 GALLERY_ASPECT_RATIO_1_1: 1 / 1,
141 GALLERY_ASPECT_RATIO_6_4: 6 / 4, 141 GALLERY_ASPECT_RATIO_6_4: 6 / 4,
142 GALLERY_ASPECT_RATIO_7_5: 7 / 5, 142 GALLERY_ASPECT_RATIO_7_5: 7 / 5,
143 GALLERY_ASPECT_RATIO_16_9: 16 / 9 143 GALLERY_ASPECT_RATIO_16_9: 16 / 9
144 }; 144 };
145 145
146 // TODO(fukino): The loop order is not guaranteed. Fix it!
oka 2016/10/06 09:11:55 suggestion: Consider using Map. A Map object itera
fukino 2016/10/06 14:34:30 Map can be used if tooling support works well. I'l
146 for (var name in aspects) { 147 for (var name in aspects) {
147 var button = toolbar.addButton( 148 var button = toolbar.addButton(
148 name, 149 name,
149 ImageEditor.Toolbar.ButtonType.LABEL, 150 ImageEditor.Toolbar.ButtonType.LABEL,
150 this.onCropAspectRatioClicked_.bind(this, toolbar, aspects[name]), 151 this.onCropAspectRatioClicked_.bind(this, toolbar, aspects[name]),
151 'crop-aspect-ratio'); 152 'crop-aspect-ratio');
152 153
153 // Prevent from cropping by Enter key if the button is focused. 154 // Prevent from cropping by Enter key if the button is focused.
154 button.addEventListener('keydown', function(event) { 155 button.addEventListener('keydown', function(event) {
155 var key = util.getKeyModifiers(event) + event.key; 156 var key = util.getKeyModifiers(event) + event.key;
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 break; 738 break;
738 case 'bottom': 739 case 'bottom':
739 this.bounds_.bottom = this.bounds_.top + newHeight; 740 this.bounds_.bottom = this.bounds_.top + newHeight;
740 break; 741 break;
741 case 'none': 742 case 'none':
742 this.bounds_.top = middle - newHeight / 2; 743 this.bounds_.top = middle - newHeight / 2;
743 this.bounds_.bottom = middle + newHeight / 2; 744 this.bounds_.bottom = middle + newHeight / 2;
744 break; 745 break;
745 } 746 }
746 }; 747 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698