Commit 05243524 authored by JC Brand's avatar JC Brand

Fix linting errors and update changelog

parent 995f2a99
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment