-
-
Notifications
You must be signed in to change notification settings - Fork 58
$mol_book in dom #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
$mol_book in dom #761
Conversation
a2dc8ba
to
a6a8f98
Compare
…not working with different tags in container
5565289
to
43d4d8b
Compare
@@ -12,6 +12,7 @@ | |||
/* padding: 0 1px; | |||
scroll-padding: 0 1px; | |||
gap: 1px; */ | |||
--mol_book2_grip_top: 1.5rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем переменная для этого?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А хедер ты меньше через переменные делаешь тоже?
[mol_book2] > *:not(:first-child):not([mol_book2]):not([mol_book2_gap])::before, | ||
/* Append dots to not last page in the book, exclude page before placeholder */ | ||
[mol_book2] > *:not(:last-child):not([mol_book2]):not([mol_book2_gap]):not(:has(+ [mol_book2_placeholder]))::after, | ||
|
||
/* Can't add dots to the book due to display: contents */ | ||
/* Prepend dots to all pages in the not first child book, exclude placeholder and second level child book */ | ||
[mol_book2] > *:not(:first-child)[mol_book2] > *:not([mol_book2]):not([mol_book2_gap])::before, | ||
|
||
/* Append dots to all pages in the not last child book not before placeholder */ | ||
[mol_book2] > *:not(:last-child)[mol_book2]:not(:has(+ [mol_book2_placeholder])) > :not([mol_book2]):not([mol_book2_gap])::after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может всё же какой-то атрибут к страницам добавлять, через призрака? А то это какая-то адская логика в стилях.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что б просетить атрибут, надо через js получить положение паги в общей иерархии паг.
Этот факт заблокирует весь первый буклет, вместо того что бы отрисовать паги с загрузкой в каждой к примеру.
Если буклет не блокировать, пропускать промис, то скорее всего будет меняться состав паг во время рендера, дребезг.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Какое отношение рендеринг призраков имеет к рендерингу бука?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не важно как добавляется атрибут, важно что для его значения надо знать где страница находится в иерархии.
Ты ж имеешь в виду атрибут типа last, first и т.д.? Без него не решить куда точки поставить, а куда нет.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не важно, где определено свойство, важно, где оно вызывается.
right: -1px; | ||
} | ||
|
||
:where([mol_book2]) > * { | ||
:where([mol_book2]) > *:not([mol_book]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А где-то ещё используется первый бук?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ошибка, тут надо book2
[mol_book2] [mol_book2] > [mol_book2_placeholder] { | ||
display: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем его тогда вообще рендерить?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проверял эвенты
Идея была в том, что буклет ничего не знает про иерархию, просто предоставляет placeholder, хотелось бы его рендерить, справа от всех, но при этом не ломая структуру дом, что б владение и эвенты адекватными оставались, типа как портал.
Но у меня не получилось так сделать на css, поэтому можно выпилить наверное.
override scroll_task_top() { | ||
// avoid mem creation for non-top book | ||
if (this.top_book) return null | ||
this.scroll_task() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему бы не сделать рекурсивную логику? Верхний бук спрашивает у нижнего куда в нём скроллить и в конечном счёте получает глубоко вложенную страницу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
непонятное что-то
У меня логика была такая:
-
страница к которой надо подскролить, может быть только одна, надо исключить конкуренцию подскролов, поэтому mem с этой логикой должен быть один. Конкуренция может появиться из-за асинхронщины при получения состава страниц в каком-либо буклете.
-
Скролл может быть только у топового буклета, следовательно дочерние никуда никуда скролить не должны.
Отсюда, как раз наоборот, дочерние буклеты должны топовому передавать страницы, к которым они хотят, что б топовый подскролил.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Речь про получение страницы в топовом буке для подскролла..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
так все мое объяснение выше про нее
Вся эта логика только в топовом и работает благодаря отсутствию this.top_book
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты там ниже ищешь страницу, к которой скроллить, не девая вложенным компонентам самим решать.
Можно встраивать mol_book в mol_book
Дочерние mol_book теперь рендерятся в дом целиком, а не только их pages, как раньше, можно юзать события, auto и другое dom-специфичное апи в дочерних mol_book.
dom_name у mol_book пришлось переделать на article, иначе не работали оранжевые точки в хедере, т.к. :first-of-type не работает с разными тегами в одном контейнере.
Также убрал minimal_height 64 в catalog в Menu
https://t.me/mam_mol/161837
т.к. подскрол в auto, надо не забывать про крышку: hyoo-ru/page.hyoo.ru#3