Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/BloomBrowserUI/bookEdit/js/linkGrid.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
/// <reference path="./collectionSettings.d.ts" />

import WebSocketManager, {
IBloomWebSocketEvent,
} from "../../utils/WebSocketManager";
import { postJson } from "../../utils/bloomApi";
import { showBookGridSetupDialog } from "../../react_components/BookGridSetup/BookGridSetupDialog";
import { Link } from "../../react_components/BookGridSetup/BookLinkTypes";

function getLanguage1Tag(): string {
const settings = GetSettings() as ICollectionSettings;
return settings.languageForNewTextBoxes;
}

export function setupBookLinkGrids(container: HTMLElement) {
// Add skeleton to empty grids on initial setup
const linkGrids = Array.from(
container.getElementsByClassName("bloom-link-grid"),
) as HTMLElement[];
const linkLang = getLanguage1Tag();
for (const linkGrid of linkGrids) {
linkGrid.lang = linkLang;
addSkeletonIfEmpty(linkGrid as HTMLElement);
// In case anyone wonders why this works here but will not on most canvas elements
// and their children...we put a rule in basepage.less that puts bloom-link-grid
Expand Down Expand Up @@ -58,6 +67,7 @@ export function editLinkGrid(linkGrid: HTMLElement) {
addSkeletonIfEmpty(linkGrid);
} else {
// Add real book buttons
linkGrid.lang = getLanguage1Tag();
links.forEach((link) => {
const button = document.createElement("div");
button.className = "bloom-bookButton";
Expand Down