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:
b953d01
)
prep for halo
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 12 Jul 2020 15:26:45 +0000
(16:26 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 12 Jul 2020 15:26:45 +0000
(16:26 +0100)
templates/script.ts
patch
|
blob
|
history
diff --git
a/templates/script.ts
b/templates/script.ts
index 10633b6d11a6fc2a9869da1781a6c4d31cf54240..b8eca386a0901029dcf01cc20c89ca317f5fe146 100644
(file)
--- a/
templates/script.ts
+++ b/
templates/script.ts
@@
-233,8
+233,13
@@
function set_ungrab(piece: PieceId, p: PieceInfo) {
piece_undisplay_grab(piece,p);
}
function piece_undisplay_grab(piece: PieceId, p: PieceInfo) {
- while (p.pelem.children.length > 1) {
- p.pelem.lastElementChild!.remove();
+ for (let celem = p.pelem.firstElementChild;
+ celem != null;
+ celem = celem.nextElementSibling) {
+ if (celem.getAttributeNS(null,"href") == "#select"+piece) {
+ celem.remove();
+ return;
+ }
}
}