mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
emoji_picker: Add get_emoji_coordinates() function.
Given the `emoji-id` of an emoji in emoji picker this function returns its coordinates, i.e, section number and index.
This commit is contained in:
committed by
Tim Abbott
parent
da86cbdaf5
commit
7546e3325f
@@ -72,6 +72,16 @@ function get_emoji_id(section, index) {
|
|||||||
return emoji_id;
|
return emoji_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_emoji_coordinates(emoji_id) {
|
||||||
|
// Emoji id is of the following form: <emoji_type>_<section_number>_<index>
|
||||||
|
// <emoji_type> itself contains two underscores. See `get_emoji_id()`.
|
||||||
|
var emoji_info = emoji_id.split("_");
|
||||||
|
return {
|
||||||
|
section: parseInt(emoji_info[3], 10),
|
||||||
|
index: parseInt(emoji_info[4], 10),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function show_search_results() {
|
function show_search_results() {
|
||||||
$(".emoji-popover-emoji-map").hide();
|
$(".emoji-popover-emoji-map").hide();
|
||||||
$(".emoji-popover-category-tabs").hide();
|
$(".emoji-popover-category-tabs").hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user