From 65288848b186079d1087029bd69dfdb7966670f2 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Tue, 13 Dec 2016 12:58:11 -0800 Subject: [PATCH] Fix Hiding Stream Creation Prompt on "Enter". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stream creation prompt would be hidden if someone clicked “Enter” and the form failed. This is presumably due to some bootstrap magic. --- static/js/subs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/subs.js b/static/js/subs.js index b14a36f4ad..73338804fd 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -859,7 +859,12 @@ $(function () { $(".subscriptions").on("click", "[data-dismiss]", function (e) { e.preventDefault(); - show_subs_pane.nothing_selected(); + // we want to make sure that the click is not just a simulated + // click; this fixes an issue where hitting "enter" would + // trigger this code path due to bootstrap magic. + if (e.clientY !== 0) { + show_subs_pane.nothing_selected(); + } }); // 'Check all' and 'Uncheck all' links