Move gallery JavaScript to gallery_detail.js
This commit is contained in:
parent
443ba11ea2
commit
1d287792df
3 changed files with 15 additions and 10 deletions
9
photologue/static/gallery_detail.js
Normal file
9
photologue/static/gallery_detail.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// This file is part of photo21
|
||||
// Copyright (C) 2022 Amicale des élèves de l'ENS Paris-Saclay
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// Init gallery
|
||||
lightGallery(document.getElementById('lightgallery'), {
|
||||
plugins: [lgAdmin, lgHash, lgThumbnail, lgZoom],
|
||||
customSlideName: true,
|
||||
});
|
||||
|
|
@ -10,8 +10,8 @@ class lgAdmin {
|
|||
constructor(instance, $LG) {
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
this.isStaff = instance.settings.isStaff;
|
||||
this.csrfToken = instance.settings.csrfToken;
|
||||
this.isStaff = document.querySelector('[name=is_staff]').value === "true";
|
||||
this.csrfToken = document.querySelector('[name=csrfmiddlewaretoken]').value;
|
||||
this.photoId = 0;
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue