Skip to content
Snippets Groups Projects
Commit aef65751 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

disable gallery action when no images are visible, fixes #620

Closes #620

Merge request studip/studip!1005
parent 01bf91be
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,10 @@ STUDIP.domReady(() => { ...@@ -49,6 +49,10 @@ 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) => { jQuery(document).on('ajaxComplete', (event, xhr) => {
if (!xhr.getResponseHeader('X-Filesystem-Changes')) { if (!xhr.getResponseHeader('X-Filesystem-Changes')) {
......
...@@ -30,6 +30,9 @@ const Files = { ...@@ -30,6 +30,9 @@ const Files = {
} }
}, },
components: { FilesTable, }, components: { FilesTable, },
mounted () {
$(document).trigger('files-vue-app-loaded');
}
}); });
}); });
} }
......
...@@ -143,7 +143,8 @@ div#sidebar-navigation { ...@@ -143,7 +143,8 @@ div#sidebar-navigation {
box-sizing: border-box; box-sizing: border-box;
line-height: 16px; line-height: 16px;
} }
span[disabled] { span[disabled],
a[disabled] {
color: $dark-gray-color-80; color: $dark-gray-color-80;
cursor: not-allowed; cursor: not-allowed;
font-weight: lighter; font-weight: lighter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment