   #
   # <button class="js-modal-trigger" data-modal-target="#target">
 
-  $modal = $("<div class='js-modal'>").appendTo('body')
-  $overlay = $('<div class="js-modal__overlay">').appendTo($modal)
+  $modal = $("<div class='js-modal'>")
+  $overlay = $('<div class="js-modal__overlay">')
   $overlay.css {
     display: "none"
     position: "fixed"

    $currentTarget = null


  $(".js-modal-trigger").on "click", ->
    target = $(this).data("modal-target")
    $modal.trigger("show",target)
    if $currentTarget != null
      $currentTarget.hide()
    $currentTarget = $(target)
    $modal.appendTo('body')
    $overlay.appendTo($modal).show()
    $currentTarget.show()

  $modal.on "hide", (e) ->
