Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solid-xmpp-chat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Components
solid-xmpp-chat
Commits
a2e2c13f
Commit
a2e2c13f
authored
4 years ago
by
ubermanu
Browse files
Options
Downloads
Patches
Plain Diff
use arrow function to keep the mixin scope
parent
e5273b7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!136
Reactions, Retract upload...
,
!117
Reactions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/sib-reactions.js
+14
-6
14 additions, 6 deletions
src/plugins/sib-reactions.js
with
14 additions
and
6 deletions
src/plugins/sib-reactions.js
+
14
−
6
View file @
a2e2c13f
...
...
@@ -209,16 +209,23 @@ converse.plugins.add('sib-reactions', {
return
_
.
values
(
emojis
);
},
// TODO: Care about overflow according to the target position
/**
* Open the emoji drawer with all the needed stuff.
* - When the user selects an emoji, it sends the reaction stanza.
* - When the user press escape, it closes the drawer.
* - When the user click outside of the drawer, it closes it.
* @param ev
*/
openEmojiPicker
(
ev
)
{
ev
.
preventDefault
();
const
self
=
this
;
// TODO: Care about overflow according to the target position
const
picker
=
new
Picker
();
self
.
appendChild
(
picker
);
this
.
appendChild
(
picker
);
picker
.
addEventListener
(
'
emoji-click
'
,
function
(
e
)
{
picker
.
addEventListener
(
'
emoji-click
'
,
e
=>
{
const
emoji
=
e
.
detail
.
unicode
;
const
emojis
=
getUserReactionEmojis
(
self
.
model
);
const
emojis
=
getUserReactionEmojis
(
this
.
model
);
// TODO: If it has the reaction from this user already, remove it? (config)
if
(
emojis
?.
includes
(
emoji
))
{
...
...
@@ -230,7 +237,7 @@ converse.plugins.add('sib-reactions', {
emojis
.
push
(
emoji
);
picker
.
remove
();
sendReactionStanza
(
self
.
model
,
emojis
);
sendReactionStanza
(
this
.
model
,
emojis
);
});
// Focus the search input when the picker opens
...
...
@@ -245,6 +252,7 @@ converse.plugins.add('sib-reactions', {
});
// Close the picker if clicked outside of it
// TODO: Remove this listener when the picker is removed from the dom
setTimeout
(()
=>
{
document
.
addEventListener
(
'
click
'
,
ev
=>
{
if
(
!
picker
.
shadowRoot
.
contains
(
ev
.
composedPath
()[
0
]))
{
...
...
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