mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +00:00
Replace home_tab_active with home_tab_obscured
(imported from commit fb8c47079e63594a22c3d47fcf373887bda6e499)
This commit is contained in:
@@ -26,7 +26,7 @@ function process_hotkey(e) {
|
||||
|
||||
// Disable hotkeys on settings page etc., and when a modal pop-up
|
||||
// is visible.
|
||||
if (!ui.home_tab_active())
|
||||
if (ui.home_tab_obscured())
|
||||
return false;
|
||||
|
||||
// Process hotkeys specially when in an input, textarea, or send button
|
||||
|
||||
@@ -2,9 +2,13 @@ var ui = (function () {
|
||||
|
||||
var exports = {};
|
||||
|
||||
// Is the home tab visible, and not covered by a modal?
|
||||
exports.home_tab_active = function () {
|
||||
return $('#home').hasClass('active') && ($('.modal:visible').length === 0);
|
||||
// What, if anything, obscures the home tab?
|
||||
exports.home_tab_obscured = function () {
|
||||
if ($('.modal:visible').length > 0)
|
||||
return 'modal';
|
||||
if (! $('#home').hasClass('active'))
|
||||
return 'other_tab';
|
||||
return false;
|
||||
};
|
||||
|
||||
// We want to remember how far we were scrolled on each 'tab'.
|
||||
@@ -414,7 +418,7 @@ $(function () {
|
||||
//
|
||||
// We don't handle the compose box here, because it *should* work to
|
||||
// select the compose box and then wheel over the message stream.
|
||||
if (exports.home_tab_active()) {
|
||||
if (!exports.home_tab_obscured()) {
|
||||
throttled_mousewheelhandler(e, delta);
|
||||
} else {
|
||||
// We need to call preventDefault() on the events that would be
|
||||
|
||||
Reference in New Issue
Block a user