Allow setting orientaiton in multi-PGN study chapter import
parent
12d562e6f9
commit
273f758808
|
@ -225,7 +225,7 @@ private[study] object ChapterMaker {
|
|||
variant: Option[String] = None,
|
||||
fen: Option[FEN] = None,
|
||||
pgn: Option[String] = None,
|
||||
orientation: String = "white", // can be "auto"
|
||||
orientation: String = "white", // can be "automatic"
|
||||
mode: String = ChapterMaker.Mode.Normal.key,
|
||||
initial: Boolean = false,
|
||||
isDefaultName: Boolean = true
|
||||
|
|
|
@ -88,9 +88,7 @@ object StudyForm {
|
|||
name = Chapter.Name((index == 0) ?? name),
|
||||
variant = variantStr,
|
||||
pgn = onePgn.some,
|
||||
orientation =
|
||||
if (pgns.sizeIs > 1) "auto"
|
||||
else (orientationStr.flatMap(chess.Color.fromName) | chess.White).name,
|
||||
orientation = orientationStr | "white",
|
||||
mode = mode,
|
||||
initial = initial && index == 0
|
||||
)
|
||||
|
|
|
@ -317,9 +317,9 @@ export function view(ctrl: StudyChapterNewFormCtrl): VNode {
|
|||
ctrl.vm.editor && ctrl.vm.editor.setOrientation((e.target as HTMLInputElement).value as Color);
|
||||
}),
|
||||
},
|
||||
['white', 'black'].map(function (color) {
|
||||
return option(color, currentChapter.setup.orientation, noarg(color));
|
||||
})
|
||||
(activeTab === 'pgn' ? ['automatic', 'white', 'black'] : ['white', 'black']).map(c =>
|
||||
option(c, currentChapter.setup.orientation, noarg(c))
|
||||
)
|
||||
),
|
||||
]),
|
||||
]),
|
||||
|
|
Loading…
Reference in New Issue