You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,15 @@ This file contains the changelog for the PlutoExtras package. It follows the [Ke
7
7
### Fixed
8
8
- Fixed problems with `ExtendedTableOfContents` with recent PlutoUI versions, also resolving an issue with `hide-heading` icon not appearing next to the corresponding heading in the ToC.
9
9
- Fixed styling issue with `BondsTable` in #19
10
+
- The `show_output_when_hidden` function now works correctly with `ExtendedTableOfContents`, not incorrectly hiding the cell input when cell should be shown normally (Fixes #46)
10
11
11
12
### Added
12
13
- Added possibility of providing any valid object with a `MIME"text/html"` representation as description of the `@NTBond` macro.
13
14
- Added the possibility of simplifying application of `PlutoUI.Experimental.transformed_value` to the fields of an `@NTBond` using the `@tv` decorator (see the example notebook for details).
14
15
15
16
### Changed
16
17
- Changed the hiding behavior of the `Popout` container so that it stays displayed if the mouse is hovering over its contents even if not popped out
18
+
- The internal logic for hiding cells in the notebook based on the ToC rows hiding status is now relying purely on JS attributes attached to cells rather than complex dynamic CSS, simplifying logic and allowing to fix some issues.
Copy file name to clipboardExpand all lines: src/extended_toc/extended_toc.js
+52-65Lines changed: 52 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -275,50 +275,6 @@ if (force_hide_enabled) {
275
275
toggle_notebook_attribute('hide-enabled',true)
276
276
}
277
277
278
-
// Hide cell blocks functionality
279
-
// For each from and to, we have to specify `pluto-cell[id]` in the part before the comm and just `[id]` in the part after the comma to ensure the specificity of the two comma-separated selectors is the same (the part after the comma has the addition of `~ pluto-cell`, so it has inherently +1 element specificity)
@@ -330,31 +286,62 @@ function toggle_state(name) {
330
286
}
331
287
}
332
288
333
-
functionupdate_hidden(e){
334
-
letnew_hide=[]
289
+
// This function will return a vector of cells indices (intended to index the list of cells in their order as return by `document.querySelectorAll('pluto-cell')`) to identify start and end index of cells to hide because their corresponding ToC row is hidden
290
+
functiontocrows_hidden_indices(){
291
+
lethidden_start_stop_idxs=[]// This will track the start and end index of cells to hide because their corresponding ToC row is hidden. The cell at the end idx should already be considered as `shown`
292
+
letcurrent_hidden_status=false// This signals whether the current is hidden or not
console.warn(`Cell with id ${linked_cell_id} not found`)
309
+
continue
352
310
}
311
+
if(hidden!=current_hidden_status){
312
+
hidden_start_stop_idxs.push(running_idx)
313
+
current_hidden_status=hidden
314
+
}
315
+
}
316
+
// If the number of elements is odd, we just add as last element the number of cells as we want consistent start and stop indices
317
+
if(hidden_start_stop_idxs.length%2!==0){
318
+
hidden_start_stop_idxs.push(cells.length)
353
319
}
354
-
if(tracking_hidden!=null){
355
-
new_hide.push([tracking_hidden,""])
320
+
returnhidden_start_stop_idxs
321
+
}
322
+
323
+
// This function takes as input a vector of start/stop indices of hidden cells (based on toc rows) and apply the `toc-hidden` cell attribute (we don't use a class as pluto constantly rewrites the cell class) to identify that a cell must be hidden
0 commit comments