Skip to content

Commit e22e9b1

Browse files
committed
markdown wrap fix
1 parent cca7592 commit e22e9b1

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-interactive-dashboard-editor",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Interactively create and customize dashboards in JupyterLab",
55
"keywords": [
66
"jupyter",

src/widget.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const EDITABLE_WIDGET_CLASS = 'pr-EditableWidget';
4242

4343
const IN_DRAG_CLASS = 'pr-InDrag';
4444

45+
const MARKDOWN_OUTPUT_CLASS = 'pr-MarkdownOutput';
46+
4547
/**
4648
* Widget to wrap delete/move/etc functionality of widgets in a dashboard (future).
4749
*/
@@ -90,10 +92,12 @@ export class DashboardWidget extends Widget {
9092
void this._notebook.context.ready.then(() => {
9193
let clone: Widget;
9294
const cellType = cell.model.type;
95+
const container = document.createElement('div');
9396

9497
switch (cellType) {
9598
case 'markdown':
9699
clone = (cell as MarkdownCell).clone().editorWidget.parent;
100+
container.classList.add(MARKDOWN_OUTPUT_CLASS);
97101
break;
98102
case 'code':
99103
clone = (cell as CodeCell).cloneOutputArea();
@@ -105,7 +109,6 @@ export class DashboardWidget extends Widget {
105109
// Make widget invisible until it's properly loaded/sized.
106110
this.node.style.opacity = '0';
107111

108-
const container = document.createElement('div');
109112
container.classList.add(DASHBOARD_WIDGET_CHILD_CLASS);
110113
container.appendChild(clone.node);
111114
this.node.appendChild(container);

style/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@
6363
display: inline-block;
6464
}
6565

66+
.pr-DashboardWidgetChild.pr-MarkdownOutput {
67+
flex-grow: 1;
68+
}
69+
6670
.pr-EditableWidget:hover .pr-Resizer {
6771
display: block;
6872
}
6973

74+
7075
.pr-Canvas {
7176
pointer-events: none;
7277
}

0 commit comments

Comments
 (0)