Skip to content

Commit 9355169

Browse files
authoredMar 30, 2023
added white space to bottom of edit files (#6804)
* added bottom white spaces to edit files * updated attribute name in edit template for consistency --------- Co-authored-by: = <=>
1 parent 2282307 commit 9355169

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed
 

‎notebook/templates/edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link rel="icon" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon-file.ico" class="favicon">
99
{% endblock %}
1010
</head>
11-
<body>
11+
<body data-notebook="edit">
1212

1313
{# Copy so we do not modify the page_config with updates. #}
1414
{% set page_config_full = page_config.copy() %}

‎packages/application/src/shell.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
5252
this._main.id = 'main-panel';
5353
this._main.node.setAttribute('role', 'main');
5454

55-
this._spacer = new Widget();
56-
this._spacer.id = 'spacer-widget';
55+
this._spacer_top = new Widget();
56+
this._spacer_top.id = 'spacer-widget-top';
57+
this._spacer_bottom = new Widget();
58+
this._spacer_bottom.id = 'spacer-widget-bottom';
5759

5860
// create wrappers around the top and menu areas
5961
topWrapper.id = 'top-panel-wrapper';
@@ -86,8 +88,9 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
8688
const middlePanel = new Panel({ layout: middleLayout });
8789
middlePanel.addWidget(this._topWrapper);
8890
middlePanel.addWidget(this._menuWrapper);
89-
middlePanel.addWidget(this._spacer);
91+
middlePanel.addWidget(this._spacer_top);
9092
middlePanel.addWidget(this._main);
93+
middlePanel.addWidget(this._spacer_bottom);
9194
middlePanel.layout = middleLayout;
9295

9396
// TODO: Consider storing this as an attribute this._hsplitPanel if saving/restoring layout needed
@@ -267,15 +270,15 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
267270
*/
268271
collapseTop(): void {
269272
this._topWrapper.setHidden(true);
270-
this._spacer.setHidden(true);
273+
this._spacer_top.setHidden(true);
271274
}
272275

273276
/**
274277
* Expand the top area to show the header and the spacer.
275278
*/
276279
expandTop(): void {
277280
this._topWrapper.setHidden(false);
278-
this._spacer.setHidden(false);
281+
this._spacer_top.setHidden(false);
279282
}
280283

281284
/**
@@ -344,7 +347,8 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
344347
private _menuHandler: PanelHandler;
345348
private _leftHandler: SidePanelHandler;
346349
private _rightHandler: SidePanelHandler;
347-
private _spacer: Widget;
350+
private _spacer_top: Widget;
351+
private _spacer_bottom: Widget;
348352
private _main: Panel;
349353
private _translator: ITranslator = nullTranslator;
350354
private _currentChanged = new Signal<this, void>(this);

‎packages/application/style/base.css

+8-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ body {
6464
max-width: var(--jp-notebook-max-width);
6565
}
6666

67-
#spacer-widget {
67+
#spacer-widget-top {
68+
min-height: 16px;
69+
}
70+
71+
/* Only edit pages should have a bottom space */
72+
73+
body[data-notebook='edit'] #spacer-widget-bottom {
6874
min-height: 16px;
6975
}
7076

@@ -80,6 +86,6 @@ body[data-notebook='notebooks'] #main-panel {
8086
max-width: unset;
8187
}
8288

83-
body[data-notebook='notebooks'] #spacer-widget {
89+
body[data-notebook='notebooks'] #spacer-widget-top {
8490
min-height: unset;
8591
}

0 commit comments

Comments
 (0)
Please sign in to comment.