Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
9099ef89
Commit
9099ef89
authored
Aug 19, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close emoji popup after insertion
parent
73c8002b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
sass/_chatbox.scss
sass/_chatbox.scss
+1
-1
src/converse-emoji-views.js
src/converse-emoji-views.js
+10
-6
No files found.
sass/_chatbox.scss
View file @
9099ef89
...
...
@@ -332,7 +332,7 @@
}
.toolbar-menu
{
background-color
:
#fff
;
bottom
:
2
rem
;
bottom
:
1
.7
rem
;
box-shadow
:
-1px
-1px
2px
0
rgba
(
0
,
0
,
0
,
0
.4
);
height
:
auto
;
margin-bottom
:
0
;
...
...
src/converse-emoji-views.js
View file @
9099ef89
...
...
@@ -116,7 +116,7 @@ converse.plugins.add('converse-emoji-views', {
},
initialize
()
{
this
.
debouncedFilter
=
_
.
debounce
(
input
=>
this
.
filter
(
input
),
10
0
);
this
.
debouncedFilter
=
_
.
debounce
(
input
=>
this
.
filter
(
input
),
5
0
);
this
.
model
.
on
(
'
change:query
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:current_skintone
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:current_category
'
,
()
=>
{
...
...
@@ -156,9 +156,8 @@ converse.plugins.add('converse-emoji-views', {
if
(
match
)
{
// XXX: Ideally we would set `query` on the model and
// then let the view re-render, instead of doing it
// manually here. Unfortunately this doesn't work, the
// value gets set on the HTML element, but is not
// visible to the new user.
// manually here. Snabbdom supports setting properties,
// Backbone.VDOMView doesn't.
ev
.
target
.
value
=
match
;
this
.
filter
(
ev
.
target
);
}
...
...
@@ -167,6 +166,7 @@ converse.plugins.add('converse-emoji-views', {
ev
.
stopPropagation
();
if
(
_converse
.
emoji_shortnames
.
includes
(
ev
.
target
.
value
))
{
this
.
chatview
.
insertIntoTextArea
(
ev
.
target
.
value
);
this
.
chatview
.
emoji_dropdown
.
toggle
();
// XXX: See above
ev
.
target
.
value
=
''
;
this
.
filter
(
ev
.
target
);
...
...
@@ -222,7 +222,10 @@ converse.plugins.add('converse-emoji-views', {
ev
.
stopPropagation
();
const
target
=
ev
.
target
.
nodeName
===
'
IMG
'
?
ev
.
target
.
parentElement
:
ev
.
target
;
const
category
=
target
.
getAttribute
(
"
data-category
"
).
trim
();
this
.
model
.
save
({
'
current_category
'
:
category
});
// XXX: See above
const
input
=
this
.
el
.
querySelector
(
'
.emoji-search
'
);
input
.
value
=
''
;
this
.
model
.
save
({
'
current_category
'
:
category
,
'
query
'
:
undefined
});
},
setScrollPosition
()
{
...
...
@@ -236,11 +239,12 @@ converse.plugins.add('converse-emoji-views', {
ev
.
preventDefault
();
ev
.
stopPropagation
();
const
target
=
ev
.
target
.
nodeName
===
'
IMG
'
?
ev
.
target
.
parentElement
:
ev
.
target
;
this
.
chatview
.
insertIntoTextArea
(
target
.
getAttribute
(
'
data-emoji
'
));
this
.
chatview
.
emoji_dropdown
.
toggle
();
// XXX: See above
const
input
=
this
.
el
.
querySelector
(
'
.emoji-search
'
);
input
.
value
=
''
;
this
.
filter
(
input
);
this
.
chatview
.
insertIntoTextArea
(
target
.
getAttribute
(
'
data-emoji
'
));
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment