Skip to content

Commit 94b2a05

Browse files
Hide trash icon when collapsing or expanding a block (#4298)
* Hide trash pop-up when collapsing or expanding a block * Hide trash pop-up when collapsing or expanding a block
1 parent 576f448 commit 94b2a05

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

js/block.js

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

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

0 commit comments

Comments
 (0)