mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
add separate unpin button to pinned shapes (#839)
Co-authored-by: 3ddy <39034386+3ddyy@users.noreply.github.com>
This commit is contained in:
@@ -217,11 +217,14 @@ export class HUDPinnedShapes extends BaseHUDPart {
|
||||
|
||||
let detector = null;
|
||||
if (canUnpin) {
|
||||
const unpinButton = document.createElement("button");
|
||||
unpinButton.classList.add("unpinButton");
|
||||
element.appendChild(unpinButton);
|
||||
element.classList.add("removable");
|
||||
detector = new ClickDetector(element, {
|
||||
detector = new ClickDetector(unpinButton, {
|
||||
consumeEvents: true,
|
||||
preventDefault: true,
|
||||
targetOnly: false,
|
||||
targetOnly: true,
|
||||
});
|
||||
detector.click.add(() => this.unpinShape(key));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user