aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-11-26 22:29:41 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-11-26 22:59:36 -1000
commite9c6f0bb743548071f5999b210fa5a8496647fae (patch)
tree51779a0c349fadfdd16115cef2487abe73b6b4e7 /lib
parent41e82f27051c7da9185794b0d71fb1857418465d (diff)
downloadpatchfoo-e9c6f0bb743548071f5999b210fa5a8496647fae.tar.gz
patchfoo-e9c6f0bb743548071f5999b210fa5a8496647fae.zip
chess moves: link to branches in full view
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 39550ac..7d50ef8 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -1435,10 +1435,16 @@ RenderMsg.prototype.chessMoveFull = function (cb) {
var fen = c.fen && c.fen.length === 2 ? c.pgnMove : c.fen
var game = parseChess(fen)
var piece = game && lookupPiece(game.board, c.dest)
- self.link(self.c.root, function (err, rootLink) {
+ var done = multicb({pluck: 1, spread: true})
+ self.link(self.c.root, done())
+ self.links(self.c.branch, done())
+ done(function (err, rootLink, branchLinks) {
if (err) return cb(err)
self.wrap([
- h('div', h('small', '> ', rootLink)),
+ rootLink ? h('div', h('small', h('span.symbol', '→'), ' ', rootLink)) : '',
+ branchLinks.map(function (a, i) {
+ return h('div', h('small', h('span.symbol', '  ↳'), ' ', a))
+ }),
h('p',
// 'player ', (c.ply || ''), ' ',
'moved ', (piece ? [renderChessSymbol(piece), ' '] : ''),