Commit 5f57c9d7 authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Chromium LUCI CQ

Files app: Fix QuickView as JS module

When running as JS module which is strict by default, the IF condition
was raising an exception because the Polymer variable isn't defined.
Fix by checking the variable explicitly in the global scope.

Bug: 1133186
Change-Id: If62e8d5fd45a4453e67810c04a6bdf3cf2033fa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637097
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844691}
parent 5af6e6fc
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
const quickView = document.querySelector('#quick-view'); const quickView = document.querySelector('#quick-view');
// Workaround: Polymer.Base is only defined on Polymer2. // Workaround: Polymer.Base is only defined on Polymer2.
// For Polymer3 the QuickView is already imported at the top. // For Polymer3 the QuickView is already imported at the top.
if (Polymer.Base) { if (window.Polymer && window.Polymer.Base) {
/* #ignore */ Polymer.Base.importHref( /* #ignore */ Polymer.Base.importHref(
/* #ignore */ constants.FILES_QUICK_VIEW_HTML, /* #ignore */ constants.FILES_QUICK_VIEW_HTML,
/* #ignore */ () => resolve(quickView), reject); /* #ignore */ () => resolve(quickView), reject);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment