Set 'base' consistently from photo-lightbox, photo-thumbnail, and ketr-photos
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
87ffebd737
commit
7f8650b0cf
@ -355,15 +355,10 @@ Polymer({
|
||||
attached: function() {
|
||||
var base = document.querySelector("base");
|
||||
if (base) {
|
||||
base = new URL(base.href).pathname.replace(/\/$/, ""); /* Remove trailing slash if there */
|
||||
this.base = new URL(base.href).pathname.replace(/\/$/, "") + "/"; /* Make sure there is a trailing slash */
|
||||
} else {
|
||||
base = "";
|
||||
this.base = "/";
|
||||
}
|
||||
/* If base is configured, add a trailing slash */
|
||||
if (base.length) {
|
||||
base += "/";
|
||||
}
|
||||
this.base = base;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -188,7 +188,7 @@
|
||||
attached: function() {
|
||||
var base = document.querySelector("base");
|
||||
if (base) {
|
||||
this.base = new URL(base.href).pathname.replace(/\/$/, "") + "/"; /* Ensure trailing slash */
|
||||
this.base = new URL(base.href).pathname.replace(/\/$/, "") + "/"; /* Make sure there is a trailing slash */
|
||||
} else {
|
||||
this.base = "/";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user