Skip to content

Commit

Permalink
js
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Jul 16, 2024
1 parent 9ab648b commit 1abd0d0
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ let PreviewActivity = {

if (window.liveSocket) {

if (!e.target.closest('#preview_content')) {
// if we're not already in preview_content (i.e. for feed in extra_contents, because it's in a different LV), don't use this and just redirect
console.log("fallback to navigate")
let uri = this.el.dataset.href || (trigger !== undefined && trigger.getAttribute('href'))
if (uri) {
this.pushEvent(
"navigate",
{ to: uri }
)
}

} else {
// if (!e.target.closest('#preview_content')) {
// // NOTE: sticky feed, see https://github.com/bonfire-networks/bonfire-app/issues/901
// // if we're not already in preview_content (i.e. for feed in extra_contents, because it's in a different LV), don't use this and just redirect
// console.log("not in preview_content div, fallback to navigate")
// let uri = this.el.dataset.href || (trigger !== undefined && trigger.getAttribute('href'))
// if (uri) {
// this.pushEvent(
// "navigate",
// { to: uri }
// )
// }

// } else {
console.log("push event to load up the PreviewContent")

// const feed = document.querySelector(".feed")
Expand Down Expand Up @@ -89,7 +90,7 @@ let PreviewActivity = {

e.preventDefault();

}
// }

} else {

Expand Down Expand Up @@ -219,9 +220,9 @@ let ClosePreview = {

} else {

if (the_extra_contents) {
const preview_content = document.getElementById("preview_content")
if (preview_content) {
console.log("click - attempt going back to main view")
const preview_content = document.getElementById("preview_content")
const main = document.getElementById("inner_inner") || document.getElementById("inner")
preview_content.classList.add("hidden")
main.classList.remove("hidden")
Expand Down

0 comments on commit 1abd0d0

Please sign in to comment.