Skip to content

Commit 50c9329

Browse files
committed
fix #7727 -- jupyter: there's no drag-n-drop to move text cells (only code cells)
1 parent a61ed50 commit 50c9329

File tree

2 files changed

+51
-50
lines changed

2 files changed

+51
-50
lines changed

src/packages/frontend/jupyter/cell-input.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ export const CellInput: React.FC<CellInputProps> = React.memo(
373373
case "markdown":
374374
if (props.is_markdown_edit) {
375375
return renderMarkdownEdit();
376-
//return render_codemirror(type);
377376
} else {
378377
return render_markdown();
379378
}
@@ -407,7 +406,9 @@ export const CellInput: React.FC<CellInputProps> = React.memo(
407406
const type = props.cell.get("cell_type") || "code";
408407

409408
function render_cell_buttonbar() {
410-
if (type !== "code" || fileContext.disableExtraButtons) return;
409+
if (type !== "code" || fileContext.disableExtraButtons) {
410+
return;
411+
}
411412
return (
412413
<CellButtonBar
413414
id={props.id}

src/packages/frontend/jupyter/prompt/input.tsx

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,61 +21,61 @@ import { capitalize } from "@cocalc/util/misc";
2121
import { INPUT_STYLE, InputPromptProps } from "./base";
2222

2323
export const InputPrompt: React.FC<InputPromptProps> = (props) => {
24-
let n;
25-
if (props.type !== "code") {
26-
return <div style={INPUT_STYLE} />;
27-
}
28-
const kernel = capitalize(props.kernel != null ? props.kernel : "");
29-
let tip: string | JSX.Element = "Enter code to be evaluated.";
30-
switch (props.state) {
31-
case "start":
32-
n = <Icon name="arrow-circle-o-left" style={{ color: "#faad14" }} />;
33-
tip = `Sending to be evaluated using ${kernel}.`;
34-
break;
35-
case "run":
36-
n = <Icon name="hand" style={{ color: "#ff4d4f" }} />;
37-
tip = `Waiting for another computation to finish first. Will evaluate using ${kernel}.`;
38-
break;
39-
case "busy":
40-
n = (
41-
<Icon
42-
name="plus-circle-filled"
43-
style={{
44-
color: "#0a830a",
45-
animation: "loadingCircle 3s infinite linear",
46-
}}
47-
/>
48-
);
49-
if (props.start != null) {
50-
tip = (
51-
<span>
52-
Running since <TimeAgo date={new Date(props.start)} /> using{" "}
53-
{kernel}.
54-
</span>
24+
function renderPrompt() {
25+
let n;
26+
if (props.type !== "code") {
27+
return <div style={INPUT_STYLE} />;
28+
}
29+
const kernel = capitalize(props.kernel != null ? props.kernel : "");
30+
let tip: string | JSX.Element = "Enter code to be evaluated.";
31+
switch (props.state) {
32+
case "start":
33+
n = <Icon name="arrow-circle-o-left" style={{ color: "#faad14" }} />;
34+
tip = `Sending to be evaluated using ${kernel}.`;
35+
break;
36+
case "run":
37+
n = <Icon name="hand" style={{ color: "#ff4d4f" }} />;
38+
tip = `Waiting for another computation to finish first. Will evaluate using ${kernel}.`;
39+
break;
40+
case "busy":
41+
n = (
42+
<Icon
43+
name="plus-circle-filled"
44+
style={{
45+
color: "#0a830a",
46+
animation: "loadingCircle 3s infinite linear",
47+
}}
48+
/>
5549
);
56-
} else {
57-
tip = `Running using ${kernel}.`;
58-
}
59-
break;
60-
default:
61-
// done (or never run)
62-
if (props.exec_count) {
63-
n = props.exec_count;
64-
if (props.end != null) {
50+
if (props.start != null) {
6551
tip = (
6652
<span>
67-
Evaluated <TimeAgo date={new Date(props.end)} /> using {kernel}.
53+
Running since <TimeAgo date={new Date(props.start)} /> using{" "}
54+
{kernel}.
6855
</span>
6956
);
70-
} else if (kernel) {
71-
tip = `Last evaluated using ${kernel}.`;
57+
} else {
58+
tip = `Running using ${kernel}.`;
7259
}
73-
} else {
74-
n = " ";
75-
}
76-
}
60+
break;
61+
default:
62+
// done (or never run)
63+
if (props.exec_count) {
64+
n = props.exec_count;
65+
if (props.end != null) {
66+
tip = (
67+
<span>
68+
Evaluated <TimeAgo date={new Date(props.end)} /> using {kernel}.
69+
</span>
70+
);
71+
} else if (kernel) {
72+
tip = `Last evaluated using ${kernel}.`;
73+
}
74+
} else {
75+
n = " ";
76+
}
77+
}
7778

78-
function renderPrompt() {
7979
return (
8080
<div
8181
style={{

0 commit comments

Comments
 (0)