fix dsel error with bbox active (#1494)

stop error when dragging outside window with dsel active; fixes 1491
This commit is contained in:
exci 2026-05-23 17:15:00 +03:00 committed by GitHub
parent ca406472f4
commit 7d81b9e837
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10036,7 +10036,7 @@ function reload_browser() {
if (e.target.closest('#widget,#ops,.opview,.doc')) return; if (e.target.closest('#widget,#ops,.opview,.doc')) return;
if (e.target.closest('#gfiles')) if (e.target.closest('#gfiles'))
ebi('gfiles').style.userSelect = "none" ebi('gfiles').style.userSelect = "none";
var pos = getpp(e); var pos = getpp(e);
startx = pos.x; startx = pos.x;
@ -10077,7 +10077,9 @@ function reload_browser() {
return; return;
} }
if (!dragging && dist > mvthresh && !window.getSelection().toString()) { if (!dragging && dist > mvthresh && !window.getSelection().toString()) {
if (fwrap = e.target.closest('#wrap')) if (e.target instanceof Element)
fwrap = e.target.closest('#wrap');
if (fwrap)
fwrap.style.userSelect = 'none'; fwrap.style.userSelect = 'none';
else return; else return;
start_drag(); start_drag();
@ -10121,7 +10123,8 @@ function reload_browser() {
window.addEventListener('dragstart', function(e) { window.addEventListener('dragstart', function(e) {
if (treectl.dsel && (is_selma || dragging)) { if (treectl.dsel && (is_selma || dragging)) {
e.preventDefault(); if (!QS('body.bbox-open'))
ev(e);
} }
}); });
} }