From: Ian Jackson Date: Tue, 13 Apr 2021 22:42:24 +0000 (+0100) Subject: js: Do grab before drag X-Git-Tag: otter-0.5.0~88 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=29d7b8ea8f7a68f1ae00d09f68064ae96c642296;p=otter.git js: Do grab before drag This is more consistent and will enable better refactoring Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 60b07c41..6168baf2 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1013,6 +1013,7 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { add_log_message('That piece is pinned to the table.'); return; } + grab_clicked(clicked); dragging = DRAGGING.MAYBE_GRAB; let for_drag = note_already ? Object.keys(note_already).concat(clicked) @@ -1025,7 +1026,6 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { +SPECIAL_MULTI_DELTA_MAX); drag_add_piece(piece,p); } - grab_clicked(clicked); } else { add_log_message('That piece is held by another player.'); return;