|
@@ -88,6 +88,10 @@ function setCollapsedState(
|
|
cell: Cell,
|
|
cell: Cell,
|
|
state: boolean
|
|
state: boolean
|
|
): void {
|
|
): void {
|
|
|
|
+ // Ensure a widget is currently focused...
|
|
|
|
+ if (tracker.currentWidget === null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
// Guard against attempting to collapse already hidden cells...
|
|
// Guard against attempting to collapse already hidden cells...
|
|
if (state) {
|
|
if (state) {
|
|
if (cell.isHidden) {
|
|
if (cell.isHidden) {
|
|
@@ -111,10 +115,6 @@ function setCollapsedState(
|
|
if (level === -1) {
|
|
if (level === -1) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // Ensure a widget is currently focused...
|
|
|
|
- if (tracker.currentWidget === null) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
const widgets = tracker.currentWidget.content.widgets;
|
|
const widgets = tracker.currentWidget.content.widgets;
|
|
const len = widgets.length;
|
|
const len = widgets.length;
|
|
const idx = widgets.indexOf(cell);
|
|
const idx = widgets.indexOf(cell);
|