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
|
// Disable hotkeys on settings page etc., and when a modal pop-up
|
||||||
// is visible.
|
// is visible.
|
||||||
if (!ui.home_tab_active())
|
if (ui.home_tab_obscured())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Process hotkeys specially when in an input, textarea, or send button
|
// Process hotkeys specially when in an input, textarea, or send button
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ var ui = (function () {
|
|||||||
|
|
||||||
var exports = {};
|
var exports = {};
|
||||||
|
|
||||||
// Is the home tab visible, and not covered by a modal?
|
// What, if anything, obscures the home tab?
|
||||||
exports.home_tab_active = function () {
|
exports.home_tab_obscured = function () {
|
||||||
return $('#home').hasClass('active') && ($('.modal:visible').length === 0);
|
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'.
|
// 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
|
// We don't handle the compose box here, because it *should* work to
|
||||||
// select the compose box and then wheel over the message stream.
|
// 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);
|
throttled_mousewheelhandler(e, delta);
|
||||||
} else {
|
} else {
|
||||||
// We need to call preventDefault() on the events that would be
|
// We need to call preventDefault() on the events that would be
|
||||||
|
|||||||
Reference in New Issue
Block a user