mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
top_left_corner: Don't export should_expand_pm_list().
We don't need to export `should_expand_pm_list` function since we are not using it anywhere else.
This commit is contained in:
committed by
Tim Abbott
parent
4a36ed6cb2
commit
6e14c39468
@@ -42,6 +42,27 @@ function deselect_top_left_corner_items() {
|
|||||||
remove($('.top_left_mentions'));
|
remove($('.top_left_mentions'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function should_expand_pm_list(filter) {
|
||||||
|
const op_is = filter.operands('is');
|
||||||
|
|
||||||
|
if (op_is.length >= 1 && op_is.includes("private")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const op_pm = filter.operands('pm-with');
|
||||||
|
|
||||||
|
if (op_pm.length !== 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const emails_strings = op_pm[0];
|
||||||
|
const emails = emails_strings.split(',');
|
||||||
|
|
||||||
|
const has_valid_emails = people.is_valid_bulk_emails_for_compose(emails);
|
||||||
|
|
||||||
|
return has_valid_emails;
|
||||||
|
}
|
||||||
|
|
||||||
exports.handle_narrow_activated = function (filter) {
|
exports.handle_narrow_activated = function (filter) {
|
||||||
deselect_top_left_corner_items();
|
deselect_top_left_corner_items();
|
||||||
|
|
||||||
@@ -70,34 +91,13 @@ exports.handle_narrow_activated = function (filter) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exports.should_expand_pm_list(filter)) {
|
if (should_expand_pm_list(filter)) {
|
||||||
pm_list.expand();
|
pm_list.expand();
|
||||||
} else {
|
} else {
|
||||||
pm_list.close();
|
pm_list.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.should_expand_pm_list = function (filter) {
|
|
||||||
const op_is = filter.operands('is');
|
|
||||||
|
|
||||||
if (op_is.length >= 1 && op_is.includes("private")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const op_pm = filter.operands('pm-with');
|
|
||||||
|
|
||||||
if (op_pm.length !== 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const emails_strings = op_pm[0];
|
|
||||||
const emails = emails_strings.split(',');
|
|
||||||
|
|
||||||
const has_valid_emails = people.is_valid_bulk_emails_for_compose(emails);
|
|
||||||
|
|
||||||
return has_valid_emails;
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.handle_narrow_deactivated = function () {
|
exports.handle_narrow_deactivated = function () {
|
||||||
deselect_top_left_corner_items();
|
deselect_top_left_corner_items();
|
||||||
pm_list.close();
|
pm_list.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user