 # ---
 
 $(document).ready(->
-  initialize_vertical_navigation()
-
   $(document).on('change', '.btn-file :file', ->
     $(this).closest('form').submit()
   )
 )
 
-initialize_beforeunload_event()
-
-if $('#comable-affix').length != 0
-  initialize_comable_affix()
-  resize_comable_affix()
-  $(window).on('resize', resize_comable_affix)
+add_beforeunload_event()
 
 $('[data-toggle="tooltip"]').tooltip()
 

# functions
# ---

initialize_beforeunload_event = ->
  $form = $('form[method!="get"]')
  $form.change(->
    $(window).on('beforeunload', (event) ->

    $(window).off('beforeunload')
  )

window.add_fields = (_this, association, content) ->
  new_id = new Date().getTime()
  regexp = new RegExp('new_' + association, 'g')
