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
Commits
1403f20f
Commit
1403f20f
authored
4 years ago
by
Shpuld Shpludson
Browse files
Options
Downloads
Patches
Plain Diff
block clicks for a second when timeline moves
parent
e2c4816f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1278
Merge develop into master for 2.2.0
,
!1266
block clicks for a second on timeline when timeline moves
Pipeline
#32259
passed
4 years ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/timeline/timeline.js
+19
-2
19 additions, 2 deletions
src/components/timeline/timeline.js
with
19 additions
and
2 deletions
src/components/timeline/timeline.js
+
19
−
2
View file @
1403f20f
...
...
@@ -2,7 +2,7 @@ import Status from '../status/status.vue'
import
timelineFetcher
from
'
../../services/timeline_fetcher/timeline_fetcher.service.js
'
import
Conversation
from
'
../conversation/conversation.vue
'
import
TimelineMenu
from
'
../timeline_menu/timeline_menu.vue
'
import
{
throttle
,
keyBy
}
from
'
lodash
'
import
{
debounce
,
throttle
,
keyBy
}
from
'
lodash
'
export
const
getExcludedStatusIdsByPinning
=
(
statuses
,
pinnedStatusIds
)
=>
{
const
ids
=
[]
...
...
@@ -34,7 +34,8 @@ const Timeline = {
paused
:
false
,
unfocused
:
false
,
bottomedOut
:
false
,
virtualScrollIndex
:
0
virtualScrollIndex
:
0
,
blockingClicks
:
false
}
},
components
:
{
...
...
@@ -124,6 +125,21 @@ const Timeline = {
this
.
$store
.
commit
(
'
setLoading
'
,
{
timeline
:
this
.
timelineName
,
value
:
false
})
},
methods
:
{
blockClickEvent
(
e
)
{
e
.
stopPropagation
()
e
.
preventDefault
()
},
stopBlockingClicks
:
debounce
(
function
()
{
this
.
blockingClicks
=
false
this
.
$el
&&
this
.
$el
.
removeEventListener
(
'
click
'
,
this
.
blockClickEvent
,
true
)
},
1000
),
blockClicksTemporarily
()
{
if
(
!
this
.
blockingClicks
)
{
this
.
$el
.
addEventListener
(
'
click
'
,
this
.
blockClickEvent
,
true
)
this
.
blockingClicks
=
true
}
this
.
stopBlockingClicks
()
},
handleShortKey
(
e
)
{
// Ignore when input fields are focused
if
([
'
textarea
'
,
'
input
'
].
includes
(
e
.
target
.
tagName
.
toLowerCase
()))
return
...
...
@@ -135,6 +151,7 @@ const Timeline = {
this
.
$store
.
commit
(
'
queueFlush
'
,
{
timeline
:
this
.
timelineName
,
id
:
0
})
this
.
fetchOlderStatuses
()
}
else
{
this
.
blockClicksTemporarily
()
this
.
$store
.
commit
(
'
showNewStatuses
'
,
{
timeline
:
this
.
timelineName
})
this
.
paused
=
false
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment