From 4dae65d5c7e1bc99b7fd04a38f14c91144ee50c6 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Mon, 31 Oct 2022 09:47:31 +0100 Subject: [PATCH] feat: enable sticky file headers by default Update the stickyFileHeaders default value to `true` so that it is enabled by default. Also correct the name of this option in the documentation by adding the missing trailing "s". --- README.md | 4 ++-- src/ui/js/diff2html-ui-base.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e88da3f..0319fb1 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ draw(): void synchronisedScroll(): void fileListToggle(startVisible: boolean): void highlightCode(): void -stickyFileHeader(): void +stickyFileHeaders(): void ``` ### Diff2HtmlUI Configuration @@ -166,7 +166,7 @@ stickyFileHeader(): void - `fileListToggle`: allow the file summary list to be toggled: `true` or `false`, default is `true` - `fileListStartVisible`: choose if the file summary list starts visible: `true` or `false`, default is `false` - `fileContentToggle`: allow each file contents to be toggled: `true` or `false`, default is `true` -- `stickyFileHeader`: make file headers sticky: `true` or `false`, default is `false` +- `stickyFileHeaders`: make file headers sticky: `true` or `false`, default is `true` - [All the options](#diff2html-configuration) from Diff2Html are also valid configurations in Diff2HtmlUI ### Diff2HtmlUI Browser diff --git a/src/ui/js/diff2html-ui-base.ts b/src/ui/js/diff2html-ui-base.ts index a1299a8..c81f713 100644 --- a/src/ui/js/diff2html-ui-base.ts +++ b/src/ui/js/diff2html-ui-base.ts @@ -32,7 +32,7 @@ export const defaultDiff2HtmlUIConfig = { */ smartSelection: true, fileContentToggle: true, - stickyFileHeaders: false, + stickyFileHeaders: true, }; export class Diff2HtmlUI {