Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: ui/file_manager/file_manager/foreground/js/quick_view_controller.js

Issue 2594613002: Quick view lazy load: initialize quick view element lazily. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/foreground/elements/elements_bundle.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/quick_view_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
index 764ed09f34548a8d5580da8a8cfe39e58a92e878..25667c77adc378c35d2996dc9c1bf19c282b5086 100644
--- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
@@ -115,12 +115,18 @@ QuickViewController.prototype.init_ = function(quickView) {
/**
* Craete quick view element.
- * TODO(oka): lazy load quick view element for fast Files App initialization.
* @return Promise<!FilesQuickView>
* @private
*/
QuickViewController.prototype.createQuickView_ = function() {
- return Promise.resolve(document.querySelector('#quick-view'));
+ return new Promise(function(resolve, reject) {
+ Polymer.Base.importHref(
+ 'foreground/elements/files_quick_view.html', function() {
+ var quickView = document.querySelector('#quick-view');
+ i18nTemplate.process(quickView, loadTimeData);
+ resolve(quickView);
+ }, reject);
+ });
};
/**
« no previous file with comments | « ui/file_manager/file_manager/foreground/elements/elements_bundle.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698