Skip to content

Commit

Permalink
remove link toc to vertical divider
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-shafi committed Jul 29, 2024
1 parent a91978a commit 9bd0949
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/blocks.build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/blocks.style.build.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/blocks/table-of-contents/front.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ document.addEventListener("DOMContentLoaded", function () {

// Link to divider block.
var tableOfContents = document.querySelectorAll('.ub_table-of-contents[data-linktodivider="true"]');
var dividers = document.querySelectorAll(".wp-block-ub-divider");
var dividers = document.querySelectorAll(".wp-block-ub-divider:not(.ub-divider-orientation-vertical)");
if (tableOfContents.length > 0 && dividers.length > 0) {
dividers.forEach(function (divider) {
var closestTOC = null;
Expand Down
5 changes: 4 additions & 1 deletion src/blocks/table-of-contents/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ document.addEventListener("DOMContentLoaded", function () {
const tableOfContents = document.querySelectorAll(
'.ub_table-of-contents[data-linktodivider="true"]',
);
const dividers = document.querySelectorAll(".wp-block-ub-divider");

const dividers = document.querySelectorAll(
".wp-block-ub-divider:not(.ub-divider-orientation-vertical)",
);

if (tableOfContents.length > 0 && dividers.length > 0) {
dividers.forEach((divider) => {
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/table-of-contents/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/blocks/table-of-contents/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,6 @@
display: block;
text-decoration: none;
color: #73accf;
width: 100%;
white-space: pre;
}

0 comments on commit 9bd0949

Please sign in to comment.