         <h2>Loading...</h2>
       </div>
     """
-
-# =====================================================
-#  Modal Helpers
-# =====================================================
-#//  poisitions modal vertical and hortizontal center, since CSS positioning causes blurry text in some cases on OS X Chrome and Safari
-centerModal = (el) ->
-  modal = $(el).find('.modal-wrapper')
-  top = ($(window).height() - modal.height()) / 2
-  left = ($(window).width() - modal.width()) / 2
-
-  modal.css('top', top).css('left', left)
-
-addModalResizeListener = (el) ->
-  $(window).resize ->
-    centerModal(el)
-
-setModalTop = (modal) ->
-  #modal.css('top', "#{$(window).scrollTop() + ($(window).height() / 10)}px")
-
-
 
 ##Override the default confirm dialog by rails
 #$.rails.allowAction = (link) ->

    if modal
      $('body').css('overflow', 'hidden')
      # // need to center during the fadeIn animation
      modal.fadeIn duration: 200,
      progress: ->
        centerModal(modal)
      done: ->
        addModalResizeListener(modal)

      Modals.currentModals.push modal

      if callbacks

          callbacks.forEach((callback) -> if _.isFunction(callback) then callback(htmlResponse))

        $('body').css('overflow', 'hidden')

    ).fail((jqXHR, textStatus, errorThrown) ->

