aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap/files.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/assets/javascripts/bootstrap/files.js')
-rw-r--r--resources/assets/javascripts/bootstrap/files.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/resources/assets/javascripts/bootstrap/files.js b/resources/assets/javascripts/bootstrap/files.js
index 72a2a6e..6caef6d 100644
--- a/resources/assets/javascripts/bootstrap/files.js
+++ b/resources/assets/javascripts/bootstrap/files.js
@@ -17,6 +17,10 @@ function searchMoreFiles (button) {
return false;
}
+STUDIP.eventBus.on('files-vue-app-updated', ({hasImages}) => {
+ $('#sidebar-actions a[onclick*="Files.openGallery"]').toggle(hasImages);
+});
+
STUDIP.domReady(() => {
STUDIP.Files.init();
@@ -49,11 +53,6 @@ STUDIP.domReady(() => {
});
});
-$(document).on('files-vue-app-loaded', () => {
- const lightboxImages = $('.lightbox-image');
- $('#sidebar-actions a[onclick*="Files.openGallery"]').attr('disabled', lightboxImages.length === 0);
-});
-
jQuery(document).on('ajaxComplete', (event, xhr) => {
if (!xhr.getResponseHeader('X-Filesystem-Changes')) {
return;