From 15687b8609aa578b4d399ec448cbc4e6056151a4 Mon Sep 17 00:00:00 2001 From: Mantas Masalskis Date: Fri, 5 Apr 2019 14:18:55 +0200 Subject: [PATCH] Fixed bug; Popover getting rendered multiple times and/or stuck. --- .../lib/app_post/popover_provider/_popover_provider.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/popover_provider/_popover_provider.coffee b/app/assets/javascripts/app/lib/app_post/popover_provider/_popover_provider.coffee index 75def93ae..5c71b89f5 100644 --- a/app/assets/javascripts/app/lib/app_post/popover_provider/_popover_provider.coffee +++ b/app/assets/javascripts/app/lib/app_post/popover_provider/_popover_provider.coffee @@ -3,11 +3,13 @@ class App.PopoverProvider @templateName = null # needs to be overrided @permission = 'ticket.agent' - @providers = {} - @providersConfigKey = 'PopoverProviders' @registerProvider: (key, klass) -> + # create hash on the fly to avoid issues with class inheritance + if !@providers + @providers = {} + @providers[key] = klass App.Config.set(key, klass, @providersConfigKey)