diff --git a/ui/analyse/src/study/chapterEditForm.ts b/ui/analyse/src/study/chapterEditForm.ts index 53731ebeecbcb..cb5cdff347450 100644 --- a/ui/analyse/src/study/chapterEditForm.ts +++ b/ui/analyse/src/study/chapterEditForm.ts @@ -8,16 +8,20 @@ import { confirm, snabDialog } from 'common/dialog'; import { h, VNode } from 'snabbdom'; import { Redraw } from '../interfaces'; import { StudySocketSend } from '../socket'; +import AnalyseCtrl from '../ctrl'; export class StudyChapterEditForm { current = prop(null); + redraw: Redraw; constructor( private readonly send: StudySocketSend, private readonly chapterConfig: (id: string) => Promise, readonly isBroadcast: boolean, - readonly redraw: Redraw, - ) {} + readonly root: AnalyseCtrl, + ) { + this.redraw = root.redraw; + } open = (data: ChapterPreview) => { this.current(data); @@ -116,7 +120,9 @@ function viewLoaded(ctrl: StudyChapterEditForm, data: StudyChapterConfig): VNode h('label.form-label', { attrs: { for: 'chapter-orientation' } }, i18n.study.orientation), h( 'select#chapter-orientation.form-control', - (['white', 'black'] as const).map(color => option(color, data.orientation, i18n.site[color])), + (['white', 'black'] as const).map(color => + option(color, ctrl.root.bottomColor(), i18n.site[color]), + ), ), ]), h('div.form-group.form-half' + (ctrl.isBroadcast ? '.none' : ''), [ diff --git a/ui/analyse/src/study/studyChapters.ts b/ui/analyse/src/study/studyChapters.ts index fc1bd16bf2b2a..0684633f4b182 100644 --- a/ui/analyse/src/study/studyChapters.ts +++ b/ui/analyse/src/study/studyChapters.ts @@ -65,7 +65,7 @@ export default class StudyChaptersCtrl { this.list = new StudyChapters(this.store); this.loadFromServer(initChapters); this.newForm = new StudyChapterNewForm(send, this.list, isBroadcast, setTab, root); - this.editForm = new StudyChapterEditForm(send, chapterConfig, isBroadcast, root.redraw); + this.editForm = new StudyChapterEditForm(send, chapterConfig, isBroadcast, root); } sort = (ids: string[]) => this.send('sortChapters', ids);