Skip to content

Commit

Permalink
ui/learn remove asumption of surrounding #main-wrap
Browse files Browse the repository at this point in the history
and apply the zindex setting during chessground creation
  • Loading branch information
ornicar committed Dec 30, 2024
1 parent 5267349 commit 129d188
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/web/src/main/ui/LearnUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ final class LearnUi(helpers: Helpers):
"data" -> data,
"pref" -> Json.obj(
"coords" -> ctx.pref.coords,
"destination" -> ctx.pref.destination
"destination" -> ctx.pref.destination,
"is3d" -> ctx.pref.is3d
)
)
)
Expand Down
1 change: 1 addition & 0 deletions ui/learn/src/chessground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ const makeConfig = (ctrl: RunCtrl): CgConfig => ({
drawable: { enabled: false },
draggable: { enabled: true },
selectable: { enabled: true },
addPieceZIndex: ctrl.pref.is3d,
});
1 change: 1 addition & 0 deletions ui/learn/src/learn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface LearnOpts {
export interface LearnPrefs {
coords: Coords;
destination: boolean;
is3d: boolean;
}

interface LearnServerOpts {
Expand Down
2 changes: 0 additions & 2 deletions ui/learn/src/run/runCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ export class RunCtrl {

setChessground = (chessground: CgApi) => {
this.chessground = chessground;
this.chessground.state.addPieceZIndex =
document.querySelector('#main-wrap')?.classList.contains('is3d') ?? false;
this.withGround(this.levelCtrl.initializeWithGround);
};

Expand Down

0 comments on commit 129d188

Please sign in to comment.