Skip to content

Commit a4c7718

Browse files
Hide trash pop-up when collapsing or expanding a block
1 parent 39171f4 commit a4c7718

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

js/block.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2894,6 +2894,22 @@ class Block {
28942894
that.blocks.triggerLongPress();
28952895
}, LONGPRESSTIME);
28962896

2897+
//hide the trash when block is being collapse or expand
2898+
const hasColExpBtns =
2899+
this.collapseButtonBitmap && this.expandButtonBitmap;
2900+
2901+
if (hasColExpBtns) {
2902+
const localPoint = this.container.globalToLocal(event.stageX, event.stageY);
2903+
const isColExpClick =
2904+
this.collapseButtonBitmap.getBounds().contains(localPoint.x, localPoint.y) ||
2905+
this.expandButtonBitmap.getBounds().contains(localPoint.x, localPoint.y);
2906+
2907+
if (isColExpClick) {
2908+
that.activity.trashcan.hide();
2909+
return;
2910+
}
2911+
}
2912+
28972913
// Always show the trash when there is a block selected,
28982914
that.activity.trashcan.show();
28992915

0 commit comments

Comments
 (0)