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
05243524
Commit
05243524
authored
Jan 07, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting errors and update changelog
parent
995f2a99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
CHANGES.md
CHANGES.md
+1
-0
src/converse-emoji-views.js
src/converse-emoji-views.js
+0
-3
src/dom-navigator.js
src/dom-navigator.js
+16
-17
No files found.
CHANGES.md
View file @
05243524
...
...
@@ -4,6 +4,7 @@
-
[
enable_smacks
](
https://conversejs.org/docs/html/configuration.html#enable-smacks
)
is not set to
`true`
by default.
-
Refactor some presence and status handling code from
`converse-core`
into
`@converse/headless/converse-status`
.
-
It's now possible to navigate the emoji-picker via the keyboard arrow keys.
-
Add support for
[
notifications about affiliation change for users not in a room
](
https://xmpp.org/extensions/xep-0045.html#example-196
)
-
Add support for
[
XEP-0424 Message Retraction
](
http://localhost:3080/extensions/xep-0424.html
)
...
...
src/converse-emoji-views.js
View file @
05243524
...
...
@@ -327,9 +327,6 @@ converse.plugins.add('converse-emoji-views', {
ev
.
preventDefault
();
ev
.
stopPropagation
();
ev
.
target
.
blur
();
const
category
=
this
.
model
.
get
(
'
current_category
'
);
// If there's no category, we're viewing search results.
const
selector
=
category
?
`ul[data-category="
${
category
}
"]`
:
'
ul
'
;
this
.
disableArrowNavigation
();
this
.
navigator
.
enable
();
this
.
navigator
.
handleKeydown
(
ev
);
...
...
src/dom-navigator.js
View file @
05243524
...
...
@@ -4,7 +4,6 @@
* This module started as a fork of Rubens Mariuzzo's dom-navigator.
* @copyright Rubens Mariuzzo, JC Brand
*/
import
log
from
"
@converse/headless/log
"
;
import
u
from
'
./utils/html
'
;
...
...
@@ -105,6 +104,22 @@ class DOMNavigator {
};
}
static
getClosestElement
(
els
,
getDistance
)
{
const
next
=
els
.
reduce
((
prev
,
curr
)
=>
{
const
current_distance
=
getDistance
(
curr
);
if
(
current_distance
<
prev
.
distance
)
{
return
{
distance
:
current_distance
,
element
:
curr
};
}
return
prev
;
},
{
distance
:
Infinity
});
return
next
.
element
;
}
/**
* Create a new DOM Navigator.
* @param { Element } container The container of the element to navigate.
...
...
@@ -189,22 +204,6 @@ class DOMNavigator {
}
}
getClosestElement
(
els
,
getDistance
)
{
const
next
=
els
.
reduce
((
prev
,
curr
)
=>
{
const
current_distance
=
getDistance
(
curr
);
if
(
current_distance
<
prev
.
distance
)
{
return
{
distance
:
current_distance
,
element
:
curr
};
}
return
prev
;
},
{
distance
:
Infinity
});
return
next
.
element
;
}
/**
* @method DOMNavigator#getNextElement
* @param {'down'|'right'|'left'|'up'} direction
...
...
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