chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff978dc
)
js: Prep mouse_find_predicate for drag selection
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 13 Apr 2021 19:47:23 +0000
(20:47 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 13 Apr 2021 20:21:28 +0000
(21:21 +0100)
We don't want to bail if we bottomed out, unless an amount was
specified.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts
patch
|
blob
|
history
diff --git
a/templates/script.ts
b/templates/script.ts
index 3557357f46f08e0e6f298e210ed5e548285a9981..dc63f2f4a7163c5e5bf4c7892d7ba4961d278c61 100644
(file)
--- a/
templates/script.ts
+++ b/
templates/script.ts
@@
-861,8
+861,11
@@
function mouse_find_predicate(
let i = clicked.length;
uelem = uelem.previousElementSibling as any;
if (uelem == pieces_marker) {
- add_log_message(`Not enough pieces! Stopped after ${i}.`);
- return null;
+ if (wanted != null) {
+ add_log_message(`Not enough pieces! Stopped after ${i}.`);
+ return null;
+ }
+ break;
}
let piece = uelem.dataset.piece!;
let p = pieces[piece];