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

Side by Side Diff: ui/file_manager/file_manager/foreground/js/naming_controller.js

Issue 2309983003: Ignore key events in renaming inputs when the keyCode is VK_PROCESSKEY(229). (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/directory_tree_naming_controller.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Controller to handle naming. 6 * Controller to handle naming.
7 * 7 *
8 * @param {!ListContainer} listContainer 8 * @param {!ListContainer} listContainer
9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog 9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog
10 * @param {!cr.ui.dialogs.ConfirmDialog} confirmDialog 10 * @param {!cr.ui.dialogs.ConfirmDialog} confirmDialog
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 this.listContainer_.table.updateFileMetadata(leadListItem, leadEntry); 205 this.listContainer_.table.updateFileMetadata(leadListItem, leadEntry);
206 } 206 }
207 this.listContainer_.currentList.restoreLeadItem(leadListItem); 207 this.listContainer_.currentList.restoreLeadItem(leadListItem);
208 }; 208 };
209 209
210 /** 210 /**
211 * @param {Event} event Key event. 211 * @param {Event} event Key event.
212 * @private 212 * @private
213 */ 213 */
214 NamingController.prototype.onRenameInputKeyDown_ = function(event) { 214 NamingController.prototype.onRenameInputKeyDown_ = function(event) {
215 // Ignore key events if event.keyCode is VK_PROCESSKEY(229).
216 // TODO(fukino): Remove this workaround once crbug.com/644140 is fixed.
217 if (event.keyCode === 229)
218 return;
219
215 if (!this.isRenamingInProgress()) 220 if (!this.isRenamingInProgress())
216 return; 221 return;
217 222
218 // Do not move selection or lead item in list during rename. 223 // Do not move selection or lead item in list during rename.
219 if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { 224 if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
220 event.stopPropagation(); 225 event.stopPropagation();
221 } 226 }
222 227
223 switch (util.getKeyModifiers(event) + event.key) { 228 switch (util.getKeyModifiers(event) + event.key) {
224 case 'Escape': 229 case 'Escape':
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 341
337 var parent = this.listContainer_.renameInput.parentNode; 342 var parent = this.listContainer_.renameInput.parentNode;
338 if (parent) 343 if (parent)
339 parent.removeChild(this.listContainer_.renameInput); 344 parent.removeChild(this.listContainer_.renameInput);
340 345
341 this.listContainer_.endBatchUpdates(); 346 this.listContainer_.endBatchUpdates();
342 347
343 // Focus may go out of the list. Back it to the list. 348 // Focus may go out of the list. Back it to the list.
344 this.listContainer_.currentList.focus(); 349 this.listContainer_.currentList.focus();
345 }; 350 };
OLDNEW
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/directory_tree_naming_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698