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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Namespace for utility functions. | 8 * Namespace for utility functions. |
9 */ | 9 */ |
10 var filelist = {}; | 10 var filelist = {}; |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 * @param {HTMLDocument} doc Owner document. | 791 * @param {HTMLDocument} doc Owner document. |
792 * @param {Entry} entry The Entry object to render. | 792 * @param {Entry} entry The Entry object to render. |
793 * @return {HTMLDivElement} The label. | 793 * @return {HTMLDivElement} The label. |
794 */ | 794 */ |
795 filelist.renderFileNameLabel = function(doc, entry) { | 795 filelist.renderFileNameLabel = function(doc, entry) { |
796 // Filename need to be in a '.filename-label' container for correct | 796 // Filename need to be in a '.filename-label' container for correct |
797 // work of inplace renaming. | 797 // work of inplace renaming. |
798 var box = doc.createElement('div'); | 798 var box = doc.createElement('div'); |
799 box.className = 'filename-label'; | 799 box.className = 'filename-label'; |
800 var fileName = doc.createElement('span'); | 800 var fileName = doc.createElement('span'); |
| 801 fileName.className = 'entry-name'; |
801 fileName.textContent = entry.name; | 802 fileName.textContent = entry.name; |
802 box.appendChild(fileName); | 803 box.appendChild(fileName); |
803 | 804 |
804 return box; | 805 return box; |
805 }; | 806 }; |
806 | 807 |
807 /** | 808 /** |
808 * Updates grid item or table row for the driveProps. | 809 * Updates grid item or table row for the driveProps. |
809 * @param {cr.ui.ListItem} li List item. | 810 * @param {cr.ui.ListItem} li List item. |
810 * @param {Object} driveProps Metadata. | 811 * @param {Object} driveProps Metadata. |
811 */ | 812 */ |
812 filelist.updateListItemDriveProps = function(li, driveProps) { | 813 filelist.updateListItemDriveProps = function(li, driveProps) { |
813 if (li.classList.contains('file')) { | 814 if (li.classList.contains('file')) { |
814 if (driveProps.availableOffline) | 815 if (driveProps.availableOffline) |
815 li.classList.remove('dim-offline'); | 816 li.classList.remove('dim-offline'); |
816 else | 817 else |
817 li.classList.add('dim-offline'); | 818 li.classList.add('dim-offline'); |
818 // TODO(mtomasz): Consider adding some vidual indication for files which | 819 // TODO(mtomasz): Consider adding some vidual indication for files which |
819 // are not cached on LTE. Currently we show them as normal files. | 820 // are not cached on LTE. Currently we show them as normal files. |
820 // crbug.com/246611. | 821 // crbug.com/246611. |
821 } | 822 } |
822 | 823 |
823 if (driveProps.customIconUrl) { | 824 if (driveProps.customIconUrl) { |
824 var iconDiv = li.querySelector('.detail-icon'); | 825 var iconDiv = li.querySelector('.detail-icon'); |
825 if (!iconDiv) | 826 if (!iconDiv) |
826 return; | 827 return; |
827 iconDiv.style.backgroundImage = 'url(' + driveProps.customIconUrl + ')'; | 828 iconDiv.style.backgroundImage = 'url(' + driveProps.customIconUrl + ')'; |
828 } | 829 } |
829 }; | 830 }; |
OLD | NEW |