mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Fix ui.home_tab_obscured call to not block scroll events.
This fixes the a call being made in ui.js that prevents all scroll events from occurring while a modal is displayed. This used to be necessary back in 2012 as modals didn't require scrolling and would affect background scrolling, however it isn't required anymore.
This commit is contained in:
committed by
Tim Abbott
parent
eece725073
commit
d17a3531b3
@@ -397,25 +397,12 @@ $(function () {
|
||||
});
|
||||
|
||||
message_viewport.message_pane.mousewheel(function (e, delta) {
|
||||
// Ignore mousewheel events if a modal is visible. It's weird if the
|
||||
// user can scroll the main view by wheeling over the grayed-out area.
|
||||
// Similarly, ignore events on settings page etc.
|
||||
//
|
||||
// We don't handle the compose box here, because it *should* work to
|
||||
// select the compose box and then wheel over the message stream.
|
||||
var obscured = exports.home_tab_obscured();
|
||||
if (!obscured) {
|
||||
if (!exports.home_tab_obscured()) {
|
||||
// In the message view, we use a throttled mousewheel handler.
|
||||
throttled_mousewheelhandler(e, delta);
|
||||
} else if (obscured === 'modal') {
|
||||
// The modal itself has a handler invoked before this one (see below).
|
||||
// preventDefault here so that the tab behind the modal doesn't scroll.
|
||||
//
|
||||
// This needs to include the events that would be ignored by throttling.
|
||||
// That's why this code can't be moved into throttled_mousewheelhandler.
|
||||
e.preventDefault();
|
||||
}
|
||||
// If on another tab, we neither handle the event nor preventDefault, allowing
|
||||
// the tab to scroll normally.
|
||||
// If in a modal, we neither handle the event nor
|
||||
// preventDefault, allowing the modal to scroll normally.
|
||||
});
|
||||
|
||||
$(window).resize($.throttle(50, resize.handler));
|
||||
|
||||
Reference in New Issue
Block a user