From 40916803e7a9d019bd8ae6c8b3e04dbcee133150 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 11 Feb 2019 16:45:37 -0800 Subject: [PATCH] floating_recipient_bar: Fix incorrect use of jQuery .next(). The semantic of jQuery's .next(selector) return nothing if the selector doesn't match the next child. --- static/js/floating_recipient_bar.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/floating_recipient_bar.js b/static/js/floating_recipient_bar.js index 090e690269..a4ff02aaa0 100644 --- a/static/js/floating_recipient_bar.js +++ b/static/js/floating_recipient_bar.js @@ -141,7 +141,11 @@ exports.relevant_recipient_bars = function () { header_height += 10; function next(elem) { - return elem.next('.recipient_row'); + elem = elem.next(); + while (elem.length !== 0 && !elem.hasClass("recipient_row")) { + elem = elem.next(); + } + return elem; } // Now start the forward traversal of recipient bars.