Skip to content

Commit

Permalink
Fixed problems with the SynchronousScrollerUtility.js and the SiteAcc…
Browse files Browse the repository at this point in the history
…essDifferencesHighlighter.js

JS:

- SiteAccessDifferencesHighlighter.js: When the highlighting state is stored in the url, then the execution of the highlighting will now take place after every parameter has loaded (changed from: Immediately prior to any other JS) in order to ensure parameters not being marked as additions, when the counterpart just hasn't loaded yet

- SynchronousScrollerUtility.js: Functionality to check for the correct list to add to has received a fix where top nodes at the top of the list, which are unique to one list, would not be added to the counterpart list and instead caused the functionality to throw an error
  • Loading branch information
JAC - Frederic Bauer committed Dec 16, 2020
1 parent c600a55 commit fb12c84
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Resources/doc/changelogs/CHANGELOG-3.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CJW-Network ConfigProcessor Bundle 3.x changelog

## 3.0.1 (xx.12.2020)

* Fixed an issue with difference highlighting: When the state was saved in the url,
the highlighting would trigger immediately before any other JS had loaded which caused
some false markings as certain classes and attributes had not been set at that point (now
it will trigger after the other JS has loaded properly)

* Fixed an issue with synchronous scrolling, where when the first node of a list was unique
to said list, the synchronous scrolling would throw an error and never complete

## 3.0 (11.12.2020)

* This changelog has been created to ship with the first full version of the bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ class SiteAccessDifferencesHighlighter {

setUpHighlighterButton() {
this.flipListener(false);
const highlight = this.utility.getStateFromUrl("highlight");

if (highlight) {
this.differenceHighlightButton.click();
}
window.addEventListener("load", () => {
if (this.utility.getStateFromUrl("highlight")) {
setTimeout(() => {
this.differenceHighlightButton.click();
});
}
});
}

highlightDifferencesAndSimilarities() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,12 @@ class SynchronousScrollerUtility {
*
* @param {HTMLElement} nodeToAdd The node which is going to be added to the given list.
* @param {HTMLElement} listToBeAddedTo The container node which serves as the list the given node is going to be added into.
*
* @returns {null|HTMLElement} Returns the list the node can be added in or null, if no adequate container could be found.
*/
confirmListToAddToOrDeliverNewOne(nodeToAdd, listToBeAddedTo) {
if (nodeToAdd && listToBeAddedTo) {
if (
nodeToAdd.parentElement &&
listToBeAddedTo.classList.contains("param_list_items")
) {
if (nodeToAdd && listToBeAddedTo && nodeToAdd.parentElement) {
if (listToBeAddedTo.classList.contains("param_list_items")) {
const nodeParent = nodeToAdd.parentElement;
const keyOfParent = nodeParent.children[0];

Expand All @@ -594,6 +592,12 @@ class SynchronousScrollerUtility {
} else {
return listToBeAddedTo;
}
} else if (
listToBeAddedTo.classList.contains("param_list") &&
nodeToAdd.parentElement.classList.contains("param_list") &&
listToBeAddedTo !== nodeToAdd.parentElement
) {
return listToBeAddedTo;
}
}

Expand Down

0 comments on commit fb12c84

Please sign in to comment.