From 7c9b4382ca1502ef76b41e255cac0725d7c9e2e9 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Tue, 16 Jan 2018 19:20:14 +0100 Subject: [PATCH] Fix Follow dialog closing when clicking any but the first Follow button --- Resources/Scripts/code.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js index ab07ac00..0ed6ab77 100644 --- a/Resources/Scripts/code.js +++ b/Resources/Scripts/code.js @@ -1240,15 +1240,17 @@ }); $(document).on("uiShowFollowFromOptions", function(){ - let event = $._data($(".js-component", ".js-modal-inner")[0], "events").click[0]; - let handler = event.handler; - let context = handler.context; - - event.handler = function(){ - overrideState(); - handler.apply(this, arguments); - restoreState(context, "stopSubsequentFollows"); - }; + $(".js-component", ".js-modal-inner").each(function(){ + let event = $._data(this, "events").click[0]; + let handler = event.handler; + let context = handler.context; + + event.handler = function(){ + overrideState(); + handler.apply(this, arguments); + restoreState(context, "stopSubsequentFollows"); + }; + }); }); })();