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 ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
7 /** @const */ var Grid = cr.ui.Grid; | 7 /** @const */ var Grid = cr.ui.Grid; |
8 /** @const */ var GridItem = cr.ui.GridItem; | 8 /** @const */ var GridItem = cr.ui.GridItem; |
9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; | 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; |
10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 /** @inheritDoc */ | 139 /** @inheritDoc */ |
140 decorate: function() { | 140 decorate: function() { |
141 Grid.prototype.decorate.call(this); | 141 Grid.prototype.decorate.call(this); |
142 this.dataModel = new ArrayDataModel([]); | 142 this.dataModel = new ArrayDataModel([]); |
143 this.itemConstructor = UserImagesGridItem; | 143 this.itemConstructor = UserImagesGridItem; |
144 this.selectionModel = new ListSingleSelectionModel(); | 144 this.selectionModel = new ListSingleSelectionModel(); |
145 this.inProgramSelection_ = false; | 145 this.inProgramSelection_ = false; |
146 this.addEventListener('dblclick', this.handleDblClick_.bind(this)); | 146 this.addEventListener('dblclick', this.handleDblClick_.bind(this)); |
147 this.addEventListener('change', this.handleChange_.bind(this)); | 147 this.addEventListener('change', this.handleChange_.bind(this)); |
148 this.setAttribute('role', 'listbox'); | 148 this.setAttribute('role', 'listbox'); |
| 149 this.autoExpands = true; |
149 }, | 150 }, |
150 | 151 |
151 /** | 152 /** |
152 * Handles double click on the image grid. | 153 * Handles double click on the image grid. |
153 * @param {Event} e Double click Event. | 154 * @param {Event} e Double click Event. |
154 * @private | 155 * @private |
155 */ | 156 */ |
156 handleDblClick_: function(e) { | 157 handleDblClick_: function(e) { |
157 // If a child element is double-clicked and not the grid itself, handle | 158 // If a child element is double-clicked and not the grid itself, handle |
158 // this as 'Enter' keypress. | 159 // this as 'Enter' keypress. |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 UserImagesGrid.ButtonImages = { | 670 UserImagesGrid.ButtonImages = { |
670 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', | 671 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', |
671 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', | 672 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', |
672 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' | 673 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' |
673 }; | 674 }; |
674 | 675 |
675 return { | 676 return { |
676 UserImagesGrid: UserImagesGrid | 677 UserImagesGrid: UserImagesGrid |
677 }; | 678 }; |
678 }); | 679 }); |
OLD | NEW |