Final tweaks to mobile outliner optimization

closes #782
This commit is contained in:
JannisX11 2021-02-20 10:31:36 +01:00
parent 8dcd87f8cf
commit 8aa2c5ba26
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
var open_menu;
var open_menu = null;
function handleMenuOverflow(node) {
node = node.get(0);
@ -333,7 +333,7 @@ class Menu {
}
hide() {
$(this.node).detach()
open_menu = undefined;
open_menu = null;
return this;
}
conditionMet() {

View File

@ -1141,6 +1141,9 @@ Interface.definePanels(function() {
}
} else {
if (e2) e2.preventDefault();
if (open_menu) open_menu.hide();
Blockbench.showQuickMessage('TEST')
if (!helper) {
helper = document.createElement('div');
@ -1185,7 +1188,7 @@ Interface.definePanels(function() {
$('.outliner_node[order]').attr('order', null);
if (Blockbench.isTouch) clearTimeout(timeout);
if (active) {
if (active && !open_menu) {
convertTouchEvent(e2);
let target = document.elementFromPoint(e2.clientX, e2.clientY);
[drop_target] = eventTargetToNode(target);
@ -1201,7 +1204,7 @@ Interface.definePanels(function() {
timeout = setTimeout(() => {
active = true;
move(e1);
}, 400)
}, 320)
}
addEventListeners(document, 'mousemove touchmove', move, {passive: false});