summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2022-02-12 09:19:02 +0100
committerDavid Ostrovsky <david.ostrovsky@gmail.com>2022-02-12 12:30:54 +0000
commit8584b3df3bfa5690c86250f225ad73f555fe468a (patch)
tree4f4e2b8f7a005898d1fa8bcf6f90d64ec376b30c
parentc90f7d920855019756d4bbfbe89e6b8ffc76f68f (diff)
gr-router: Fix renaming of app id to pg-app
In Ice695c47c8 the id of grp-app element was changed from "app" to "pg-app" but one place was missed to be renamed. To avoid proliferation of pg-app id across the code base, replace lookup done by getElementById with lookup done by querySelector with gr-app element. Bug: Issue 15686 Change-Id: I4fbf7ecc2644567919672bd91a1de506797408c9 Release-Notes: skip
-rw-r--r--polygerrit-ui/app/elements/core/gr-router/gr-router.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
index 7f89fc3720..63478476db 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -262,7 +262,7 @@ const LEGACY_QUERY_SUFFIX_PATTERN = /,n,z$/;
const REPO_TOKEN_PATTERN = /\${(project|repo)}/g;
// Polymer makes `app` intrinsically defined on the window by virtue of the
-// custom element having the id "app", but it is made explicit here.
+// custom element having the id "pg-app", but it is made explicit here.
// If you move this code to other place, please update comment about
// gr-router and gr-app in the PolyGerritIndexHtml.soy file if needed
const app = document.querySelector('gr-app');
@@ -332,11 +332,11 @@ export class GrRouter extends PolymerElement {
// explicitly in app, or by delegating to it.
// It is expected that application has a GrAppElement(id=='app-element')
- // at the document level or inside the shadow root of the GrApp (id='app')
+ // at the document level or inside the shadow root of the GrApp ('gr-app')
// element.
return (document.getElementById('app-element') ||
document
- .getElementById('app')!
+ .querySelector('gr-app')!
.shadowRoot!.getElementById('app-element')!) as AppElement;
}