diff --git a/static/js/ui.js b/static/js/ui.js index f78586b74a..6ecc1cdf52 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -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));