Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85805112
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/scroll_top_button/scroll_top_button.js b/src/components/scroll_top_button/scroll_top_button.js
index e4b908f0b8..41340dbad0 100644
--- a/src/components/scroll_top_button/scroll_top_button.js
+++ b/src/components/scroll_top_button/scroll_top_button.js
@@ -1,18 +1,19 @@
const ScrollTopButton = {
props: {
fast: {
type: Boolean,
required: false,
default: false,
},
},
+ inject: ['bodyScrollPosition'],
methods: {
scrollToTop() {
const speed = this.fast ? 'instant' : 'smooth'
- window.scrollTo({ top: 0, behavior: speed })
+ this.bodyScrollPosition.scrollTo({ top: 0, behavior: speed })
},
},
}
export default ScrollTopButton
diff --git a/src/composables/useDocumentFocus.js b/src/composables/useDocumentFocus.js
index 8e31fea859..ae09327b06 100644
--- a/src/composables/useDocumentFocus.js
+++ b/src/composables/useDocumentFocus.js
@@ -1,35 +1,35 @@
import { nextTick, onMounted, onUnmounted, ref } from 'vue'
export function useDocumentFocus() {
- const focused = ref(false)
+ const focused = ref(!document.hidden)
const handleVisibilityChange = async () => {
focused.value = !document.hidden
}
onMounted(async () => {
if (document.hidden !== undefined) {
document.addEventListener(
'visibilitychange',
handleVisibilityChange,
false,
)
}
await nextTick()
})
onUnmounted(() => {
if (document.hidden !== undefined) {
document.removeEventListener(
'visibilitychange',
handleVisibilityChange,
false,
)
}
})
return {
focused,
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Oct 11, 1:31 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1785529
Default Alt Text
(1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment