gdf
This commit is contained in:
@@ -1623,8 +1623,7 @@ body.layout-modern .global-sidebar-right {
|
|||||||
.global-sidebar-right img,
|
.global-sidebar-right img,
|
||||||
.item-sidebar-right img,
|
.item-sidebar-right img,
|
||||||
.index-sidebar-right img {
|
.index-sidebar-right img {
|
||||||
-webkit-user-drag: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Edge zone drag handle — simple centered vertical pill */
|
/* Edge zone drag handle — simple centered vertical pill */
|
||||||
|
|||||||
@@ -46,11 +46,19 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark internal drags to prevent them from triggering the dropzone
|
||||||
|
window.addEventListener('dragstart', (e) => {
|
||||||
|
if (e.dataTransfer) {
|
||||||
|
e.dataTransfer.setData('application/x-f0ck-internal', 'true');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Global Drag Events
|
// Global Drag Events
|
||||||
window.addEventListener('dragenter', (e) => {
|
window.addEventListener('dragenter', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (window.location.pathname === '/upload') return;
|
if (window.location.pathname === '/upload') return;
|
||||||
if (e.dataTransfer.types.includes('Files')) {
|
if (e.dataTransfer && e.dataTransfer.types.includes('application/x-f0ck-internal')) return;
|
||||||
|
if (e.dataTransfer && e.dataTransfer.types.includes('Files')) {
|
||||||
dragCounter++;
|
dragCounter++;
|
||||||
dropOverlay.classList.add('active');
|
dropOverlay.classList.add('active');
|
||||||
}
|
}
|
||||||
@@ -59,10 +67,17 @@
|
|||||||
window.addEventListener('dragover', (e) => {
|
window.addEventListener('dragover', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (window.location.pathname === '/upload') return;
|
if (window.location.pathname === '/upload') return;
|
||||||
|
if (e.dataTransfer && e.dataTransfer.types.includes('application/x-f0ck-internal')) {
|
||||||
|
// Change dropEffect to none to indicate this dropzone doesn't accept internal elements
|
||||||
|
e.dataTransfer.dropEffect = 'none';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('dragleave', (e) => {
|
window.addEventListener('dragleave', (e) => {
|
||||||
if (window.location.pathname === '/upload') return;
|
if (window.location.pathname === '/upload') return;
|
||||||
|
// dragleave doesn't always have reliable dataTransfer.types, but if it does, check it
|
||||||
|
if (e.dataTransfer && e.dataTransfer.types.includes('application/x-f0ck-internal')) return;
|
||||||
|
|
||||||
dragCounter--;
|
dragCounter--;
|
||||||
if (dragCounter <= 0) {
|
if (dragCounter <= 0) {
|
||||||
dragCounter = 0;
|
dragCounter = 0;
|
||||||
@@ -72,6 +87,8 @@
|
|||||||
|
|
||||||
window.addEventListener('drop', (e) => {
|
window.addEventListener('drop', (e) => {
|
||||||
if (window.location.pathname === '/upload') return;
|
if (window.location.pathname === '/upload') return;
|
||||||
|
if (e.dataTransfer && e.dataTransfer.types.includes('application/x-f0ck-internal')) return;
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dragCounter = 0;
|
dragCounter = 0;
|
||||||
dropOverlay.classList.remove('active');
|
dropOverlay.classList.remove('active');
|
||||||
|
|||||||
Reference in New Issue
Block a user