Skip to content

Commit 9c78bdc

Browse files
authored
Merge pull request #7977 from BloomBooks/BL-16351-BookButtonFont
Control the font used for book buttons in RAB books (BL-16351)
2 parents bc40eb8 + 5d9bcb0 commit 9c78bdc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/BloomBrowserUI/bookEdit/js/linkGrid.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
/// <reference path="./collectionSettings.d.ts" />
2+
13
import WebSocketManager, {
24
IBloomWebSocketEvent,
35
} from "../../utils/WebSocketManager";
46
import { postJson } from "../../utils/bloomApi";
57
import { showBookGridSetupDialog } from "../../react_components/BookGridSetup/BookGridSetupDialog";
68
import { Link } from "../../react_components/BookGridSetup/BookLinkTypes";
79

10+
function getLanguage1Tag(): string {
11+
const settings = GetSettings() as ICollectionSettings;
12+
return settings.languageForNewTextBoxes;
13+
}
14+
815
export function setupBookLinkGrids(container: HTMLElement) {
916
// Add skeleton to empty grids on initial setup
1017
const linkGrids = Array.from(
1118
container.getElementsByClassName("bloom-link-grid"),
1219
) as HTMLElement[];
20+
const linkLang = getLanguage1Tag();
1321
for (const linkGrid of linkGrids) {
22+
linkGrid.lang = linkLang;
1423
addSkeletonIfEmpty(linkGrid as HTMLElement);
1524
// In case anyone wonders why this works here but will not on most canvas elements
1625
// and their children...we put a rule in basepage.less that puts bloom-link-grid
@@ -58,6 +67,7 @@ export function editLinkGrid(linkGrid: HTMLElement) {
5867
addSkeletonIfEmpty(linkGrid);
5968
} else {
6069
// Add real book buttons
70+
linkGrid.lang = getLanguage1Tag();
6171
links.forEach((link) => {
6272
const button = document.createElement("div");
6373
button.className = "bloom-bookButton";

0 commit comments

Comments
 (0)