Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Merge requests
!769
Mobile Post button fix
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Mobile Post button fix
eugenijm/pleroma-fe:fix/floating-button
into
develop
Overview
17
Commits
2
Pipelines
14
Changes
6
Merged
Eugenij
requested to merge
eugenijm/pleroma-fe:fix/floating-button
into
develop
5 years ago
Overview
14
Commits
2
Pipelines
14
Changes
6
Expand
Closes
#506 (closed)
0
0
Merge request reports
Compare
develop
version 13
ea6daa2a
5 years ago
version 12
ae1496cf
5 years ago
version 11
8c9c774d
5 years ago
version 10
3e26bb4c
5 years ago
version 9
caa44471
5 years ago
version 8
81be6a21
5 years ago
version 7
c8bb7be7
5 years ago
version 6
6a4f285f
5 years ago
version 5
162dae49
5 years ago
version 4
6b02fd9d
5 years ago
version 3
17de84e4
5 years ago
version 2
85b87faf
5 years ago
version 1
d3436fe8
5 years ago
develop (base)
and
latest version
latest version
b18fea85
2 commits,
5 years ago
version 13
ea6daa2a
2 commits,
5 years ago
version 12
ae1496cf
1 commit,
5 years ago
version 11
8c9c774d
1 commit,
5 years ago
version 10
3e26bb4c
1 commit,
5 years ago
version 9
caa44471
1 commit,
5 years ago
version 8
81be6a21
1 commit,
5 years ago
version 7
c8bb7be7
1 commit,
5 years ago
version 6
6a4f285f
1 commit,
5 years ago
version 5
162dae49
1 commit,
5 years ago
version 4
6b02fd9d
1 commit,
5 years ago
version 3
17de84e4
1 commit,
5 years ago
version 2
85b87faf
1 commit,
5 years ago
version 1
d3436fe8
1 commit,
5 years ago
6 files
+
49
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/components/mobile_post_status_modal/mobile_post_status_modal.js
+
38
−
21
Options
import
PostStatusForm
from
'
../post_status_form/post_status_form.vue
'
import
{
throttl
e
}
from
'
lodash
'
import
{
debounc
e
}
from
'
lodash
'
const
MobilePostStatusModal
=
{
components
:
{
@@ -16,11 +16,15 @@ const MobilePostStatusModal = {
}
},
created
()
{
window
.
addEventListener
(
'
scroll
'
,
this
.
handleScroll
)
if
(
this
.
autohideFloatingPostButton
)
{
this
.
activateFloatingPostButtonAutohide
()
}
window
.
addEventListener
(
'
resize
'
,
this
.
handleOSK
)
},
destroyed
()
{
window
.
removeEventListener
(
'
scroll
'
,
this
.
handleScroll
)
if
(
this
.
autohideFloatingPostButton
)
{
this
.
deactivateFloatingPostButtonAutohide
()
}
window
.
removeEventListener
(
'
resize
'
,
this
.
handleOSK
)
},
computed
:
{
@@ -28,10 +32,30 @@ const MobilePostStatusModal = {
return
this
.
$store
.
state
.
users
.
currentUser
},
isHidden
()
{
return
this
.
hidden
||
this
.
inputActive
return
this
.
autohideFloatingPostButton
&&
(
this
.
hidden
||
this
.
inputActive
)
},
autohideFloatingPostButton
()
{
return
!!
this
.
$store
.
state
.
config
.
autohideFloatingPostButton
}
},
watch
:
{
autohideFloatingPostButton
:
function
(
isEnabled
)
{
if
(
isEnabled
)
{
this
.
activateFloatingPostButtonAutohide
()
}
else
{
this
.
deactivateFloatingPostButtonAutohide
()
}
}
},
methods
:
{
activateFloatingPostButtonAutohide
()
{
window
.
addEventListener
(
'
scroll
'
,
this
.
handleScrollStart
)
window
.
addEventListener
(
'
scroll
'
,
this
.
handleScrollEnd
)
},
deactivateFloatingPostButtonAutohide
()
{
window
.
removeEventListener
(
'
scroll
'
,
this
.
handleScrollStart
)
window
.
removeEventListener
(
'
scroll
'
,
this
.
handleScrollEnd
)
},
openPostForm
()
{
this
.
postFormOpen
=
true
this
.
hidden
=
true
@@ -65,26 +89,19 @@ const MobilePostStatusModal = {
this
.
inputActive
=
false
}
},
handleScroll
:
throttle
(
function
()
{
const
scrollAmount
=
window
.
scrollY
-
this
.
oldScrollPos
const
scrollingDown
=
scrollAmount
>
0
if
(
scrollingDown
!==
this
.
scrollingDown
)
{
this
.
amountScrolled
=
0
this
.
scrollingDown
=
scrollingDown
if
(
!
scrollingDown
)
{
this
.
hidden
=
false
}
}
else
if
(
scrollingDown
)
{
this
.
amountScrolled
+=
scrollAmount
if
(
this
.
amountScrolled
>
100
&&
!
this
.
hidden
)
{
this
.
hidden
=
true
}
handleScrollStart
:
debounce
(
function
()
{
if
(
window
.
scrollY
>
this
.
oldScrollPos
)
{
this
.
hidden
=
true
}
else
{
this
.
hidden
=
false
}
this
.
oldScrollPos
=
window
.
scrollY
},
100
,
{
leading
:
true
,
trailing
:
false
}),
handleScrollEnd
:
debounce
(
function
()
{
this
.
hidden
=
false
this
.
oldScrollPos
=
window
.
scrollY
this
.
scrollingDown
=
scrollingDown
},
100
)
},
100
,
{
leading
:
false
,
trailing
:
true
})
}
}
Loading