mirror of https://github.com/zulip/zulip.git
Blur the active element on settings/streams modal exit.
This blurs any focused element so that you can’t accidentally enter into anything on a hidden modal.
This commit is contained in:
parent
af857d883b
commit
660144a79d
|
@ -248,6 +248,7 @@ exports.initialize = function () {
|
|||
|
||||
exports.exit_settings = function (callback) {
|
||||
if (should_ignore(window.location.hash)) {
|
||||
ui.blur_active_element();
|
||||
ignore.flag = true;
|
||||
window.location.hash = ignore.prev || "#";
|
||||
if (typeof callback === "function") {
|
||||
|
|
|
@ -35,6 +35,11 @@ exports.focus_on = function (field_id) {
|
|||
$("#" + field_id).focus();
|
||||
};
|
||||
|
||||
exports.blur_active_element = function () {
|
||||
// this blurs anything that may perhaps be actively focused on.
|
||||
document.activeElement.blur();
|
||||
};
|
||||
|
||||
function amount_to_paginate() {
|
||||
// Some day we might have separate versions of this function
|
||||
// for Page Up vs. Page Down, but for now it's the same
|
||||
|
|
Loading…
Reference in New Issue