mirror of
https://github.com/discourse/DiscoTOC.git
synced 2025-03-06 17:30:16 +00:00
FIX: Remove anchor generated by theme component (#13)
Core adds anchors to all headings.
This commit is contained in:
parent
c64a82b4b8
commit
113d3a8612
@ -133,23 +133,6 @@
|
|||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.d-toc-post-heading {
|
|
||||||
.d-toc-anchor-link {
|
|
||||||
font-size: initial;
|
|
||||||
color: transparent;
|
|
||||||
transition: color 0.15s linear;
|
|
||||||
:not(.rtl) & {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
.rtl & {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:hover .d-toc-anchor-link {
|
|
||||||
color: var(--primary-medium, $primary-medium);
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#bottom-anchor {
|
#bottom-anchor {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
@ -31,16 +31,6 @@
|
|||||||
return cleanItem;
|
return cleanItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
const createAnchors = id => {
|
|
||||||
const link = $("<a/>", {
|
|
||||||
href: `#${id}`,
|
|
||||||
class: "d-toc-anchor-link",
|
|
||||||
html: linkIcon
|
|
||||||
});
|
|
||||||
|
|
||||||
return link;
|
|
||||||
};
|
|
||||||
|
|
||||||
const setUpTocItem = function (item) {
|
const setUpTocItem = function (item) {
|
||||||
const unique = item.attr("id");
|
const unique = item.attr("id");
|
||||||
const text = item.text();
|
const text = item.text();
|
||||||
@ -302,7 +292,6 @@
|
|||||||
id: id,
|
id: id,
|
||||||
"data-d-toc": id
|
"data-d-toc": id
|
||||||
})
|
})
|
||||||
.append(createAnchors(id))
|
|
||||||
.addClass("d-toc-post-heading");
|
.addClass("d-toc-post-heading");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user