Fix closing item sidebar for printing label modal [SCI-9541] (#6486)

This commit is contained in:
ajugo 2023-10-19 09:48:20 +02:00 committed by GitHub
parent 8b5f610c07
commit aed5418366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,11 +295,11 @@ export default {
if (!this.isShowing) return
const sidebar = this.$refs.wrapper;
// Check if the clicked element is not within the sidebar and it's not another item link or belogs to modal
if (!sidebar.contains(event.target) &&
!event.target.closest('a') &&
!event.target.closest('.modal')) {
this.toggleShowHideSidebar(null)
// Check if the clicked element is not within the sidebar and it's not another item link or belogs to modals
const selectors = ['a', '.modal', '.label-printing-progress-modal'];
if (!sidebar.contains(event.target) && !selectors.some(selector => event.target.closest(selector))) {
this.toggleShowHideSidebar(null);
}
},
toggleShowHideSidebar(repositoryRowUrl, myModuleId = null) {