non-game studies
parent
e2f04bd4a5
commit
3b7aa64155
|
@ -34,11 +34,15 @@ final class StudyMultiBoard(
|
|||
|
||||
private implicit val previewBSONReader = new BSONDocumentReader[ChapterPreview] {
|
||||
def read(doc: BSONDocument) = {
|
||||
val node = doc.getAs[Node.Root]("root").err("Preview missing root").lastMainlineNode
|
||||
val players = doc.getAs[Tags]("tags") flatMap ChapterPreview.players
|
||||
val root = doc.getAs[Node.Root]("root").err("Preview missing root")
|
||||
val node =
|
||||
if (players.isDefined) root.lastMainlineNode
|
||||
else root
|
||||
ChapterPreview(
|
||||
id = doc.getAs[Chapter.Id]("_id") err "Preview missing id",
|
||||
name = doc.getAs[Chapter.Name]("name") err "Preview missing name",
|
||||
players = doc.getAs[Tags]("tags") flatMap ChapterPreview.players,
|
||||
players = players,
|
||||
orientation = doc.getAs[Bdoc]("setup") flatMap { setup =>
|
||||
setup.getAs[Color]("orientation")
|
||||
} getOrElse Color.White,
|
||||
|
|
|
@ -576,8 +576,7 @@ body.base .study_buttons .fbt.active {
|
|||
}
|
||||
|
||||
#now_playing {
|
||||
padding-left: 1px;
|
||||
white-space: nowrap;
|
||||
padding: 0 0 0 1px;
|
||||
}
|
||||
#now_playing .spinner {
|
||||
margin: 50px auto;
|
||||
|
@ -594,14 +593,23 @@ body.base .study_buttons .fbt.active {
|
|||
#now_playing > a:hover {
|
||||
background: rgba(191, 231, 255, 0.7);
|
||||
}
|
||||
#now_playing a.active {
|
||||
#now_playing a.active,
|
||||
#now_playing a:active {
|
||||
background: rgba(99,155,36,0.8);
|
||||
color: #fff;
|
||||
}
|
||||
#now_playing .player {
|
||||
height: 1.5em;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
#now_playing .name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
div.advice_summary {
|
||||
margin-top: 42px;
|
||||
|
|
|
@ -40,8 +40,12 @@ function makePreview(study: StudyCtrl) {
|
|||
makePlayer(preview.players[opposite(preview.orientation)]),
|
||||
makeCg(preview),
|
||||
makePlayer(preview.players[preview.orientation])
|
||||
] : [makeCg(preview)];
|
||||
] : [
|
||||
h('div.name', preview.name),
|
||||
makeCg(preview)
|
||||
];
|
||||
return h('a.mini_board', {
|
||||
attrs: { title: preview.name },
|
||||
class: { active: study.vm.chapterId == preview.id },
|
||||
hook: bind('mousedown', _ => study.setChapter(preview.id))
|
||||
}, contents);
|
||||
|
|
Loading…
Reference in New Issue