From 8831b57b9bce4632bbb167bb0912501372c8b87b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 25 Feb 2019 13:04:45 +0100 Subject: [PATCH] Remove model-open class if App.ControllerModalLoading class is used without container. --- .../controllers/_application_controller_generic.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee index a825b8a8b..6ce648472 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee @@ -260,11 +260,14 @@ class App.ControllerModalLoading extends App.Controller @render() - @el.modal + @el.modal( keyboard: false show: true backdrop: 'static' container: @container + ).on( + 'hidden.bs.modal': @localOnClosed + ) render: -> @html App.view('generic/modal_loader')( @@ -283,9 +286,12 @@ class App.ControllerModalLoading extends App.Controller showIcon: => @$('.js-loadingIcon').removeClass('hide') + localOnClosed: => + @el.remove() + hide: (delay) => remove = => - @el.remove() + @el.modal('hide') if !delay remove() return