chiark / gitweb /
js: Multi select, actually select as many as we want!
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Apr 2021 23:46:17 +0000 (00:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Apr 2021 19:07:53 +0000 (20:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 672e5fbf026b063941daedeb29a567b02cf95466..cc8b3e438d3c4b8f9d874a307aafd9f28c9ed66a 100644 (file)
@@ -851,7 +851,8 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) {
     let clickpos = mouseevent_pos(e);
     clicked = [];
     let uelem = defs_marker;
-    for (let i=0; i<special_count; i++) {
+    while (clicked.length < special_count) {
+      let i = clicked.length;
       uelem = uelem.previousElementSibling as any;
       if (uelem == pieces_marker) {
        add_log_message(`Not enough pieces!  Stopped after ${i}.`);