 FactlinkApp.module "DiscussionModalOnFrontend", (DiscussionModalOnFrontend, MyApp, Backbone, Marionette, $, _) ->
 
   background_page_url = null
+  discussionModalContainer = null
 
   # keep url in sync with ChannelsRouter
   showFactRegex = Backbone.Router::_routeToRegExp ':slug/f/:fact_id'

  DiscussionModalOnFrontend.closeDiscussion = ->
    FactlinkApp.discussionModalRegion.close()
    FactlinkApp.ModalWindowContainer.close()


    showFactRegex.test(fragment)

  modalCurrentlyOpened = ->
    discussionModalContainer?

  DiscussionModalOnFrontend.addInitializer ->
    return if FactlinkApp.modal
