Fixed various actor filters. Improved tag bar scroll behavior.
This commit is contained in:
@@ -461,7 +461,7 @@ async function unstash() {
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0 .5rem 0 0;
|
||||
margin: 0 .5rem 1rem 0;
|
||||
line-height: 1.25;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
@@ -94,20 +94,25 @@ const categoryTitles = {
|
||||
const activeCategory = ref(null);
|
||||
|
||||
function calculateActiveCategory() {
|
||||
activeCategory.value = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => {
|
||||
const newCategory = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => {
|
||||
const { top } = element.getBoundingClientRect();
|
||||
|
||||
if (!closest || Math.abs(top) < Math.abs(closest.top)) {
|
||||
if (!closest || Math.abs(top - 200) < Math.abs(closest.top)) { // slight offset to include bottom category
|
||||
return { category: element.dataset.category, top };
|
||||
}
|
||||
|
||||
return closest;
|
||||
}, null).category;
|
||||
|
||||
if (newCategory === activeCategory.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
activeCategory.value = newCategory;
|
||||
|
||||
const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`);
|
||||
|
||||
activeLink.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
inline: 'center',
|
||||
});
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ const tagSlugs = {
|
||||
'piercings',
|
||||
],
|
||||
lgbt: [
|
||||
'lesbian',
|
||||
'gay',
|
||||
'bisexual',
|
||||
'transsexual',
|
||||
|
||||
Reference in New Issue
Block a user