Always load lg-admin plugin

This commit is contained in:
Alexandre Iooss 2022-03-01 21:06:58 +01:00
parent 6376e3b550
commit 695ec94d7c
2 changed files with 4 additions and 1 deletions

View file

@ -8,6 +8,7 @@ class lgAdmin {
constructor(instance, $LG) {
this.core = instance;
this.$LG = $LG;
this.isStaff = instance.settings.isStaff;
return this;
}
@ -19,6 +20,7 @@ class lgAdmin {
onAfterSlide(event) {
const photoId = this.core.galleryItems[event.detail.index].slideName;
document.getElementById("lg-admin").href = `https://photos.crans.org/admin/photologue/photo/${photoId}/change/`;
document.getElementById("lg-admin").style.display = this.isStaff ? 'block' : 'none';
}
// Admin must have destroy prototype