self.setRenderFunction(self.renderTableRow_.bind(self,
self.getRenderFunction()));
- self.scrollBar_ = MainPanelScrollBar();
+ self.scrollBar_ = new MainPanelScrollBar();
self.scrollBar_.initialize(self, self.list);
// Keep focus on the file list when clicking on the header.
self.header.addEventListener('mousedown', function(e) {
*
* @param {number} x X coordinate value.
* @param {number} y Y coordinate value.
- * @param {=number} opt_width Width of the coordinate.
- * @param {=number} opt_height Height of the coordinate.
+ * @param {number=} opt_width Width of the coordinate.
+ * @param {number=} opt_height Height of the coordinate.
* @return {Array.<number>} Index list of hit elements.
*/
self.list.getHitElements = function(x, y, opt_width, opt_height) {
*/
FileTable.prototype.setDateTimeFormat = function(use12hourClock) {
this.timeFormatter_ = Intl.DateTimeFormat(
- [] /* default locale */,
- {hour: 'numeric', minute: 'numeric',
- hour12: use12hourClock});
+ [] /* default locale */,
+ {hour: 'numeric', minute: 'numeric', hour12: use12hourClock});
this.dateFormatter_ = Intl.DateTimeFormat(
- [] /* default locale */,
- {year: 'numeric', month: 'short', day: 'numeric',
- hour: 'numeric', minute: 'numeric',
- hour12: use12hourClock});
+ [] /* default locale */,
+ {
+ year: 'numeric', month: 'short', day: 'numeric',
+ hour: 'numeric', minute: 'numeric', hour12: use12hourClock
+ });
};
/**
// If the pointed item is already selected, it should not start the drag
// selection.
- if (this.lastSelection_.indexOf(itemIndex) !== -1)
+ if (this.lastSelection_ && this.lastSelection_.indexOf(itemIndex) !== -1)
return false;
// If the horizontal value is not hit to column, it should start the drag
return;
} else if (filesystemProps.size === 0 &&
FileType.isHosted(entry)) {
- var driveProps = this.metadataCache_.getCached(entry, 'drive');
- if (!driveProps) {
+ var externalProps = this.metadataCache_.getCached(entry, 'external');
+ if (!externalProps) {
var locationInfo = this.volumeManager_.getLocationInfo(entry);
if (locationInfo && locationInfo.isDriveBased) {
// Should not reach here, since we already have size metadata.
div.textContent = '...';
return;
}
- } else if (driveProps.hosted) {
+ } else if (externalProps.hosted) {
div.textContent = '--';
return;
}
forEachCell('.table-row-cell > .size', function(item, entry, unused) {
this.updateSize_(item, entry);
});
- } else if (type === 'drive') {
+ } else if (type === 'external') {
// The cell name does not matter as the entire list item is needed.
forEachCell('.table-row-cell > .date', function(item, entry, listItem) {
- var props = this.metadataCache_.getCached(entry, 'drive');
- filelist.updateListItemDriveProps(listItem, props);
+ var props = this.metadataCache_.getCached(entry, 'external');
+ filelist.updateListItemExternalProps(listItem, props);
});
}
};
li.classList.add(entry.isDirectory ? 'directory' : 'file');
// The metadata may not yet be ready. In that case, the list item will be
// updated when the metadata is ready via updateListItemsMetadata. For files
- // not on Drive, driveProps is not available.
- var driveProps = metadataCache.getCached(entry, 'drive');
- if (driveProps)
- filelist.updateListItemDriveProps(li, driveProps);
+ // not on an external backend, externalProps is not available.
+ var externalProps = metadataCache.getCached(entry, 'external');
+ if (externalProps)
+ filelist.updateListItemExternalProps(li, externalProps);
// Overriding the default role 'list' to 'listbox' for better
// accessibility on ChromeOS.
};
/**
- * Updates grid item or table row for the driveProps.
+ * Updates grid item or table row for the externalProps.
* @param {cr.ui.ListItem} li List item.
- * @param {Object} driveProps Metadata.
+ * @param {Object} externalProps Metadata.
*/
-filelist.updateListItemDriveProps = function(li, driveProps) {
+filelist.updateListItemExternalProps = function(li, externalProps) {
if (li.classList.contains('file')) {
- if (driveProps.availableOffline)
+ if (externalProps.availableOffline)
li.classList.remove('dim-offline');
else
li.classList.add('dim-offline');
if (!iconDiv)
return;
- if (driveProps.customIconUrl)
- iconDiv.style.backgroundImage = 'url(' + driveProps.customIconUrl + ')';
+ if (externalProps.customIconUrl)
+ iconDiv.style.backgroundImage = 'url(' + externalProps.customIconUrl + ')';
else
iconDiv.style.backgroundImage = ''; // Back to the default image.
if (li.classList.contains('directory'))
- iconDiv.classList.toggle('shared', driveProps.shared);
+ iconDiv.classList.toggle('shared', externalProps.shared);
};