ff
This commit is contained in:
+5
-10
@@ -18702,7 +18702,7 @@ body.onara-modal-open #sidebar-drag-zone {
|
||||
box-sizing: border-box !important;
|
||||
animation: onaraFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
transition: right 0.3s ease-in-out !important;
|
||||
cursor: pointer;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
body.onara-modal-open .onara-modal-wrapper {
|
||||
@@ -18750,7 +18750,7 @@ body.sidebar-right-hidden .onara-modal-wrapper {
|
||||
height: 100% !important;
|
||||
min-height: 100% !important;
|
||||
z-index: 1 !important;
|
||||
cursor: pointer;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.onara-modal-content {
|
||||
@@ -18765,7 +18765,7 @@ body.sidebar-right-hidden .onara-modal-wrapper {
|
||||
flex: 1 0 auto !important;
|
||||
padding: 20px 0 80px 0 !important;
|
||||
box-sizing: border-box !important;
|
||||
cursor: pointer;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#onara-item-mount {
|
||||
@@ -18774,7 +18774,7 @@ body.sidebar-right-hidden .onara-modal-wrapper {
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
justify-content: flex-start !important;
|
||||
cursor: pointer;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Center the item layout inside modal and make it 100% scrollable */
|
||||
@@ -18796,18 +18796,13 @@ body.layout-modern #onara-modal .item-layout-container {
|
||||
box-sizing: border-box !important;
|
||||
grid-template-columns: none !important;
|
||||
grid-template-rows: none !important;
|
||||
cursor: pointer;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#onara-modal .item-main-content,
|
||||
body.layout-legacy #onara-modal .item-layout-container .item-main-content,
|
||||
body.layout-modern #onara-modal .item-layout-container .item-main-content {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
#onara-modal .item-main-content,
|
||||
body.layout-legacy #onara-modal .item-layout-container .item-main-content,
|
||||
body.layout-modern #onara-modal .item-layout-container .item-main-content {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
|
||||
+49
-7
@@ -1194,17 +1194,59 @@ window.cancelAnimFrame = (function () {
|
||||
window.closeOnaraModal = closeOnaraModal;
|
||||
window.isOnaraActive = isOnaraActive;
|
||||
|
||||
// Onara modal close click delegation: clicking outside .item-main-content closes modal
|
||||
// Onara modal close click delegation: clicking on empty/free space closes the modal
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!document.body.classList.contains('onara-modal-open')) return;
|
||||
// Do not close if clicking inside the item content
|
||||
if (e.target.closest('.item-main-content')) return;
|
||||
// Do not close if clicking auxiliary modals, dropdowns, or notifications
|
||||
if (e.target.closest('.modal-overlay:not(#onara-modal), .modal-content, .swal2-container, .tippy-box, #comments-container .emoji-picker')) return;
|
||||
// Do not close if clicking the global sidebar right or navbar (as modal respects them)
|
||||
|
||||
// Do not close if clicking auxiliary modals, dropdowns, tooltips, or emoji pickers
|
||||
if (e.target.closest('.modal-overlay:not(#onara-modal), .modal-content, .swal2-container, .tippy-box, #comments-container .emoji-picker, .dropdown-menu, .custom-confirm-overlay')) return;
|
||||
|
||||
// Do not close if clicking the global sidebar right or navbar
|
||||
if (e.target.closest('.global-sidebar-right, nav.navbar, #sidebar-drag-zone')) return;
|
||||
|
||||
// Any click outside .item-main-content (e.g. left side, right side, backdrop, modal background) closes
|
||||
// Do not close if clicking interactive content elements or actual item components
|
||||
const contentElementSelector = [
|
||||
'.media-object',
|
||||
'.previous-post',
|
||||
'.next-post',
|
||||
'.arrow-prev',
|
||||
'.arrow-next',
|
||||
'#prev',
|
||||
'#next',
|
||||
'.nav-prev',
|
||||
'.nav-next',
|
||||
'#random',
|
||||
'.location',
|
||||
'.item_title',
|
||||
'.blahlol',
|
||||
'#comments-container',
|
||||
'.tag-controls',
|
||||
'.sidebar-tags-container',
|
||||
'.xd-score-wrapper',
|
||||
'.user-infobox-block',
|
||||
'a',
|
||||
'button',
|
||||
'input',
|
||||
'textarea',
|
||||
'select',
|
||||
'label',
|
||||
'form',
|
||||
'video',
|
||||
'audio',
|
||||
'img',
|
||||
'canvas',
|
||||
'iframe',
|
||||
'.iconset',
|
||||
'.badge',
|
||||
'.btn',
|
||||
'time',
|
||||
'[role="button"]',
|
||||
'i[class*="fa-"]'
|
||||
].join(', ');
|
||||
|
||||
if (e.target.closest(contentElementSelector)) return;
|
||||
|
||||
// Any click on free space (backdrop, modal wrapper, container background, empty space in item-main-content) closes
|
||||
if (e.target.closest('#onara-modal') || e.target.id === 'onara-backdrop') {
|
||||
e.preventDefault();
|
||||
closeOnaraModal();
|
||||
|
||||
Reference in New Issue
Block a user