// Skip effects when reloading repeatedly very quickly.
var time = Date.now();
if (this.lastLoadTime_ &&
- (time - this.lastLoadTime_) < ImageView.FAST_SCROLL_INTERVAL) {
+ (time - this.lastLoadTime_) < ImageView.FAST_SCROLL_INTERVAL) {
effect = null;
}
this.lastLoadTime_ = time;
} else {
var cachedScreen = item.screenImage;
var imageWidth = metadata.media && metadata.media.width ||
- metadata.drive && metadata.drive.imageWidth;
+ metadata.external && metadata.external.imageWidth;
var imageHeight = metadata.media && metadata.media.height ||
- metadata.drive && metadata.drive.imageHeight;
+ metadata.external && metadata.external.imageHeight;
if (cachedScreen) {
// We have a cached screen-scale canvas, use it instead of a thumbnail.
displayThumbnail(ImageView.LOAD_TYPE_CACHED_SCREEN, cachedScreen);
width = metadata.media.width;
height = metadata.media.height;
}
- // If metadata.drive.present is true, the image data is loaded directly
+ // If metadata.external.present is true, the image data is loaded directly
// from local cache, whose size may be out of sync with the drive
// metadata.
- if (metadata.drive && !metadata.drive.present) {
- width = metadata.drive.imageWidth;
- height = metadata.drive.imageHeight;
+ if (metadata.external && !metadata.external.present) {
+ width = metadata.external.imageWidth;
+ height = metadata.external.imageHeight;
}
self.replace(
canvas,
loadType, ImageView.LOAD_TYPE_TOTAL);
if (loadType === ImageView.LOAD_TYPE_ERROR &&
- !navigator.onLine && metadata.streaming) {
- // |streaming| is set only when the file is not locally cached.
+ !navigator.onLine && !metadata.external.present) {
loadType = ImageView.LOAD_TYPE_OFFLINE;
}
if (loadCallback) loadCallback(loadType, animationDuration, opt_error);
this.setTransform_(this.screenImage_, this.viewport_, effect);
this.screenImage_.setAttribute('fade', true);
this.unloadTimer_ = setTimeout(function() {
- this.unloadTimer_ = null;
- this.unload(null /* force unload */);
- }.bind(this),
- effect.getSafeInterval());
+ this.unloadTimer_ = null;
+ this.unload(null /* force unload */);
+ }.bind(this), effect.getSafeInterval());
return;
}
this.container_.textContent = '';
* Obtains the CSS transformation string of the effect.
* @param {DOMCanvas} element Canvas element to be applied the transformation.
* @param {Viewport} viewport Current viewport.
- * @return CSS transformation description.
+ * @return {string} CSS transformation description.
*/
ImageView.Effect.prototype.transform = function(element, viewport) {
throw new Error('Not implemented.');
+ return '';
};
/**