Skip to content

Commit f139621

Browse files
committed
fix #7235 -- course zoom
1 parent fff05d8 commit f139621

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/packages/frontend/course/configuration/configuration-panel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export function ConfigurationPanel({
5050
const actions = useActions<CourseActions>({ name });
5151

5252
return (
53-
<div className="smc-vfill" style={{ overflowY: "scroll" }}>
53+
<div
54+
className="smc-vfill"
55+
style={{
56+
overflowY: "scroll",
57+
}}
58+
>
5459
<Row>
5560
<Col md={12} style={{ padding: "15px 15px 15px 0" }}>
5661
<UpgradeConfiguration

src/packages/frontend/frame-editors/course-editor/course-panel-wrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import type { CourseEditorActions, CourseEditorState } from "./actions";
3737
import { CourseStore } from "@cocalc/frontend/course/store";
3838
import { PayBanner } from "@cocalc/frontend/course/pay-banner";
3939
import Modals from "@cocalc/frontend/course/modals";
40+
import { getScale } from "@cocalc/frontend/frame-editors/frame-tree/hooks";
4041

4142
export interface FrameProps {
4243
id: string;
@@ -127,7 +128,9 @@ function CoursePanelWrapper(props: FrameProps) {
127128
{render_error()}
128129
{render_pay_banner()}
129130
{render_tab_bar()}
130-
{React.createElement(course_panel, props)}
131+
<div style={{ zoom: getScale(font_size) }} className="smc-vfill">
132+
{React.createElement(course_panel, props)}
133+
</div>
131134
</>
132135
);
133136
}
@@ -203,7 +206,6 @@ function CoursePanelWrapper(props: FrameProps) {
203206
return (
204207
<div
205208
style={{
206-
fontSize: `${font_size}px`,
207209
padding: "0 15px",
208210
background: "#fafafa",
209211
}}

src/packages/frontend/frame-editors/course-editor/editor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import { menu } from "@cocalc/frontend/i18n";
2525
import { ENV_VARS_ICON } from "@cocalc/frontend/project/settings/environment";
2626

2727
const commands = set([
28-
// commented out for now since broken: See https://github.com/sagemathinc/cocalc/issues/7235
29-
//"decrease_font_size",
30-
//"increase_font_size",
28+
"decrease_font_size",
29+
"increase_font_size",
30+
"set_zoom",
3131
"save",
3232
"time_travel",
3333
"help",

src/packages/frontend/frame-editors/frame-tree/hooks.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export function baseFontSize() {
2424
// transform: `scale(${scaling})`,
2525
// transformOrigin: "center 0", // or "0 0"
2626
// }
27+
// And yet, I'm using zoom and testing it on safari, firefox and chrome
28+
// and it works well now-a-days.
29+
2730
export function use_font_size_scaling(font_size: number): number {
2831
return getScale(font_size);
2932
}

0 commit comments

Comments
 (0)