OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var DeletableItemList = options.DeletableItemList; | 6 /** @const */ var DeletableItemList = options.DeletableItemList; |
7 /** @const */ var DeletableItem = options.DeletableItem; | 7 /** @const */ var DeletableItem = options.DeletableItem; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
10 | 10 |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 }, | 747 }, |
748 | 748 |
749 /** | 749 /** |
750 * Handles key down events and looks for left and right arrows, then | 750 * Handles key down events and looks for left and right arrows, then |
751 * dispatches to the currently expanded item, if any. | 751 * dispatches to the currently expanded item, if any. |
752 * @param {Event} e The keydown event. | 752 * @param {Event} e The keydown event. |
753 * @private | 753 * @private |
754 */ | 754 */ |
755 handleKeyLeftRight_: function(e) { | 755 handleKeyLeftRight_: function(e) { |
756 var id = e.key; | 756 var id = e.key; |
757 if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) | 757 if (hasKeyModifiers(e)) |
758 return; | 758 return; |
759 if ((id == 'ArrowLeft' || id == 'ArrowRight') && this.expandedItem) { | 759 if ((id == 'ArrowLeft' || id == 'ArrowRight') && this.expandedItem) { |
760 var cs = this.ownerDocument.defaultView.getComputedStyle(this); | 760 var cs = this.ownerDocument.defaultView.getComputedStyle(this); |
761 var rtl = cs.direction == 'rtl'; | 761 var rtl = cs.direction == 'rtl'; |
762 if ((!rtl && id == 'ArrowLeft') || (rtl && id == 'ArrowRight')) | 762 if ((!rtl && id == 'ArrowLeft') || (rtl && id == 'ArrowRight')) |
763 this.expandedItem.selectedIndex--; | 763 this.expandedItem.selectedIndex--; |
764 else | 764 else |
765 this.expandedItem.selectedIndex++; | 765 this.expandedItem.selectedIndex++; |
766 this.scrollIndexIntoView(this.expandedItem.listIndex); | 766 this.scrollIndexIntoView(this.expandedItem.listIndex); |
767 // Prevent the page itself from scrolling. | 767 // Prevent the page itself from scrolling. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 parent.endBatchUpdates(); | 952 parent.endBatchUpdates(); |
953 }, | 953 }, |
954 }; | 954 }; |
955 | 955 |
956 return { | 956 return { |
957 CookiesList: CookiesList, | 957 CookiesList: CookiesList, |
958 CookieListItem: CookieListItem, | 958 CookieListItem: CookieListItem, |
959 CookieTreeNode: CookieTreeNode, | 959 CookieTreeNode: CookieTreeNode, |
960 }; | 960 }; |
961 }); | 961 }); |
OLD | NEW |