1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Fix pinned shapes not being removable

This commit is contained in:
tobspr
2020-10-07 18:05:11 +02:00
parent 7dccc1a844
commit f3dcdeb2b8
2 changed files with 8 additions and 17 deletions

View File

@@ -217,11 +217,11 @@ export class HUDPinnedShapes extends BaseHUDPart {
let detector = null;
if (canUnpin) {
element.classList.add("unpinable");
element.classList.add("removable");
detector = new ClickDetector(element, {
consumeEvents: true,
preventDefault: true,
targetOnly: true,
targetOnly: false,
});
detector.click.add(() => this.unpinShape(key));
} else {
@@ -294,6 +294,7 @@ export class HUDPinnedShapes extends BaseHUDPart {
* @param {string} key
*/
unpinShape(key) {
console.log("unpin", key);
arrayDeleteValue(this.pinnedShapes, key);
this.rerenderFull();
}