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 /** | 5 /** |
6 * FileGrid constructor. | 6 * FileGrid constructor. |
7 * | 7 * |
8 * Represents grid for the Grid Vew in the File Manager. | 8 * Represents grid for the Grid Vew in the File Manager. |
9 * @constructor | 9 * @constructor |
10 * @extends {cr.ui.Grid} | 10 * @extends {cr.ui.Grid} |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 * @param {HTMLDivElement} box Box to decorate. | 87 * @param {HTMLDivElement} box Box to decorate. |
88 * @param {Entry} entry Entry which thumbnail is generating for. | 88 * @param {Entry} entry Entry which thumbnail is generating for. |
89 * @param {MetadataCache} metadataCache To retrieve metadata. | 89 * @param {MetadataCache} metadataCache To retrieve metadata. |
90 * @param {ThumbnailLoader.FillMode} fillMode Fill mode. | 90 * @param {ThumbnailLoader.FillMode} fillMode Fill mode. |
91 * @param {function(HTMLElement)} opt_imageLoadCallback Callback called when | 91 * @param {function(HTMLElement)} opt_imageLoadCallback Callback called when |
92 * the image has been loaded before inserting | 92 * the image has been loaded before inserting |
93 * it into the DOM. | 93 * it into the DOM. |
94 */ | 94 */ |
95 FileGrid.decorateThumbnailBox = function( | 95 FileGrid.decorateThumbnailBox = function( |
96 box, entry, metadataCache, fillMode, opt_imageLoadCallback) { | 96 box, entry, metadataCache, fillMode, opt_imageLoadCallback) { |
97 var self = this; | |
98 | |
99 box.className = 'img-container'; | 97 box.className = 'img-container'; |
100 if (entry.isDirectory) { | 98 if (entry.isDirectory) { |
101 box.setAttribute('generic-thumbnail', 'folder'); | 99 box.setAttribute('generic-thumbnail', 'folder'); |
102 if (opt_imageLoadCallback) | 100 if (opt_imageLoadCallback) |
103 setTimeout(opt_imageLoadCallback, 0, null /* callback parameter */); | 101 setTimeout(opt_imageLoadCallback, 0, null /* callback parameter */); |
104 return; | 102 return; |
105 } | 103 } |
106 | 104 |
107 var imageUrl = entry.toURL(); | 105 var imageUrl = entry.toURL(); |
108 | 106 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 checkBox.classList.add('white'); | 165 checkBox.classList.add('white'); |
168 var bottom = li.querySelector('.thumbnail-bottom'); | 166 var bottom = li.querySelector('.thumbnail-bottom'); |
169 bottom.appendChild(checkBox); | 167 bottom.appendChild(checkBox); |
170 bottom.classList.add('show-checkbox'); | 168 bottom.classList.add('show-checkbox'); |
171 } | 169 } |
172 | 170 |
173 // Override the default role 'listitem' to 'option' to match the parent's | 171 // Override the default role 'listitem' to 'option' to match the parent's |
174 // role (listbox). | 172 // role (listbox). |
175 li.setAttribute('role', 'option'); | 173 li.setAttribute('role', 'option'); |
176 }; | 174 }; |
OLD | NEW |