Skip to content

Commit 5191041

Browse files
committed
fix(pat gallery): Correctly re-use existing default templates.
1 parent 8a341aa commit 5191041

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pat/gallery/gallery.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export default Base.extend({
3636
this.options = parser.parse(this.el, this.options);
3737

3838
// Use default template, if no other template is defined.
39-
if (!document.getElementById("photoswipe-template")) {
39+
this.template = document.querySelector(
40+
".pat-gallery__template-wrapper, #photoswipe-template"
41+
);
42+
if (!this.template) {
4043
const raw_template = (await import("./template.html")).default;
4144
this.template = document.createElement("div");
4245
this.template.setAttribute("class", "pat-gallery__template-wrapper");

0 commit comments

Comments
 (0)