File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -408,9 +408,8 @@ function addCommands(
408408 icon : runIcon ,
409409 execute : ( args ) => {
410410 const widget = outputTracker . currentWidget ;
411- const cell = widget . cell as CodeCell ;
412411 const sessionContext = widget . notebook . sessionContext ;
413- CodeCell . execute ( cell , sessionContext ) ;
412+ CodeCell . execute ( widget . cell as CodeCell , sessionContext ) ;
414413 } ,
415414 } ) ;
416415
Original file line number Diff line number Diff line change @@ -93,10 +93,17 @@ export class DashboardWidget extends Widget {
9393 let clone : Widget ;
9494 const cellType = cell . model . type ;
9595 const container = document . createElement ( 'div' ) ;
96+ let cloneNode : HTMLElement ;
97+ let nodes : HTMLCollectionOf < Element > ;
98+ let node : HTMLElement ;
9699
97100 switch ( cellType ) {
98101 case 'markdown' :
99- clone = ( cell as MarkdownCell ) . clone ( ) . editorWidget . parent ;
102+ cloneNode = ( cell as MarkdownCell ) . clone ( ) . node ;
103+ nodes = cloneNode . getElementsByClassName ( 'jp-MarkdownOutput' ) ;
104+ node = nodes [ 0 ] as HTMLElement ;
105+ node . style . paddingRight = '0' ;
106+ clone = new Widget ( { node } ) ;
100107 container . classList . add ( MARKDOWN_OUTPUT_CLASS ) ;
101108 break ;
102109 case 'code' :
@@ -569,6 +576,14 @@ export class DashboardWidget extends Widget {
569576 this . _locked = newState ;
570577 }
571578
579+ get content ( ) : Widget {
580+ return this . _content ;
581+ }
582+ set content ( newContent : Widget ) {
583+ this . _content . dispose ( ) ;
584+ this . _content = newContent ;
585+ }
586+
572587 private _notebook : NotebookPanel ;
573588 private _notebookId : string ;
574589 private _index : number ;
Original file line number Diff line number Diff line change 33}
44
55.pr-DashboardWidget {
6- display : flex;
6+ display : inline- flex;
77 align-items : center;
88 justify-content : center;
99}
1010
11+ .pr-DashboardWidget .pr-MarkdownOutput {
12+ display : inline-block;
13+ }
14+
1115.pr-EditableWidget {
1216 border : var (--jp-border-width ) solid var (--jp-inverse-layout-color4 );
1317 background : var (--jp-layout-color0 );
6367 display : inline-block;
6468}
6569
66- .pr-DashboardWidgetChild .pr-MarkdownOutput {
67- flex-grow : 1 ;
68- }
69-
7070.pr-EditableWidget : hover .pr-Resizer {
7171 display : block;
7272}
You can’t perform that action at this time.
0 commit comments