-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add display none for preview and add hide actions #223
Conversation
@@ -5,7 +5,7 @@ | |||
</div> | |||
<% @filters.each do |filter| %> | |||
<% url = message_threads_path(q: filter.query) %> | |||
<%= link_to url, class: "text-gray-700 hover:text-indigo-600 hover:bg-gray-50 group w-72 flex gap-x-3 rounded-md p-2 px-4 text-sm leading-6 font-semibold data-[active=true]:bg-gray-50 data-[active=true]:text-indigo-600", data: { active: current_page?(url) } do %> | |||
<%= link_to url, "data-action": "click->slideover#hide", class: "text-gray-700 hover:text-indigo-600 hover:bg-gray-50 group w-72 flex gap-x-3 rounded-md p-2 px-4 text-sm leading-6 font-semibold data-[active=true]:bg-gray-50 data-[active=true]:text-indigo-600", data: { active: current_page?(url) } do %> |
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.
Teraz som z tohto zmateny, tak riesi to ten data-turbo-preview hore alebo ideme na kazdu linku takto riesit (co nie je asi dobre)
@jsuchal Vyzera, ze to zafungovalo aj len s css 🤔 Ci este mas nejaky scenar, kde to nastavalo? Screen.Recording.2023-12-01.at.09.52.21.mov |
Ak je to 🆗 , tak pridam aj na ostatne dynamicke elementy. |
Myslim, ze scenare boli vsetky prvky ked ich otvoris a potom das back a forward. modal, dropdown. Nepamatam si uplne ten scenar ale je to zjavne vtedy ked sa nacachuje nejaky otvoreny prvok co tam nechces aby bol ked sa vratis spat (resp. kliknes na rovnaky link - url+get method- vtedy ide z cache) |
Hmm, nie je to este uplne dobre. Zobrazuje sa to pri back/forward Screen.Recording.2023-12-01.at.10.06.31.movdata-action by to asi vyriesilo 🤔 |
@LukasJanik este zvazujem nejaky js ktory sa napichne vseobecne na dokument a pri nejakom turbo evente prejde vsetky tieto preview-hide elementy a proste ich pred cache schova. cize nieco ako https://turbo.hotwired.dev/handbook/building#preparing-the-page-to-be-cached document.querySelectorAll("[data-preview-cache-hide]").forEach(function(elm) {
elm.addEventListener("turbo:before-cache", function() {
// schovaj elm
}
}) |
Ja navrhujem spravit nejake nase elementy tak, ze vyrobime triedy ktore budeme na toto pouzivat. Tak ako turbo ma |
Zatial sa mi nepodarilo vymysliet lepsie riesenie nez reload pri back/forward. Hral som sa aj s odstranovanim Screen.Recording.2023-12-05.at.08.03.16.mov |
@jsuchal vyzera, ze to zafungovalo 😄 🥳 Sry, ze to tolko trvalo. Screen.Recording.2023-12-05.at.08.55.00.mov |
No description provided.