Skip to content

Commit

Permalink
Remove fix needed for colors theme (fixed upstream) which enables sim…
Browse files Browse the repository at this point in the history
…plification od code
  • Loading branch information
ddrury authored and magicsunday committed Dec 11, 2021
1 parent 7cf15b2 commit 2b856ee
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions resources/views/modules/pedigree-chart/page.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ function getUrl(baseUrl, generations)

/**
* Set visibility of "Show more options" to previous state after page reload.
* Toggle text on "Show more options" on click.
*
* @param {Storage} storage
*/
Expand All @@ -194,20 +195,14 @@ function toggleMoreOptions(storage)
storage.write("showMoreOptions", false);
});

const toggleText = () => {
Array.from(optionsToggle.children).forEach((element, index) => {
element.classList.toggle('d-none');
});
};

optionsToggle.addEventListener('click', () => {
optionsToggle.blur(); // needed for colors theme (see https://github.com/fisharebest/webtrees/issues/4053)
toggleText();
Array.from(optionsToggle.children).forEach((element, index) => {
element.classList.toggle('d-none');
});
});

if (storage.read("showMoreOptions")) {
showMoreOptions.classList.add('show');
toggleText();
optionsToggle.click()
}
}

Expand Down

0 comments on commit 2b856ee

Please sign in to comment.