-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix collapsing on identical reprs (#5) and performance improvements.
Caching of reprs broke collapsing behavior that depended on unique UUIDs to tie label elements to hidden checkbox inputs. To fix that, labels and inputs are now connected implicitly by nesting elements. This change to the HTML structure prevents a pure CSS solution to collapsing, so a JS snippet was added to restore collapsing behavior. Skipping UUID generation substantially reduced HTML generation time and slightly decreased output HTML size. Another performance boost was achieved by removing singledispatch which has a substantial overhead and replacing with simple isinstance checks.
- Loading branch information
Showing
7 changed files
with
175 additions
and
71 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function toggleHeader() { | ||
const parent = this.parentElement; | ||
const open = "eerepr-header-open"; | ||
const closed = "eerepr-header-closed"; | ||
parent.className = parent.className === open ? closed : open; | ||
} | ||
|
||
for (let c of document.getElementsByClassName("eerepr-collapser")) { | ||
c.onclick = toggleHeader; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters