     @text           = $('.text', @el).first()
     @collapsedText  = $('.text.collapse', @el)
     @collapseToggle = $('.toggle-wrapper svg', @el)
+    @modalToggle  = $('> [data-toggle="modal"]', @inner)
+    @modalDismiss = $("[data-dismiss][data-target='#{@modalToggle.data('target')}']")
+    @modal        = $(@modalToggle.data('target'))
+
+    @modal.on 'shown.bs.modal',          => @modalDismiss.show()
+    @modal.on 'hide.bs.modal',           => @modalDismiss.hide()
+    @modalDismiss.on 'touchstart click', => @modal.modal('hide')
+    @collapseToggle.on 'click',          => @onCollapseToggleClick()
 
     if @collapsedText.length
       @collapsedText.collapse(toggle: false)

  computeTextCollapseHeight: ->
    @text.css 'height', 0

    collapse_or_modal_toggle =
      if @collapseToggle.is(':visible')
        @collapseToggle
      else
        @modalToggle

    diff = collapse_or_modal_toggle.offset().top - @text.offset().top - 30
    if diff < 160 then 160 else diff

  computeTextFullHeight: ->

      @text.dotdotdot(watch: 'window')
      @fitText()

  refresh: ->
    @closeCollapse()
    setTimeout (=> @fitText()), 300

  fitText: =>
    return if @collapsedText.length
