   if $func
     eval "$(link).#{$func}"
 
+  $callback = $(link).data("callback-after")
+  if $callback
+    eval "#{$callback}"
+
 $ ->
 
   $("a[rel=popover]").popover()
   $(".tooltip").tooltip()
   $("a[rel=tooltip]").tooltip()
 
-  $.fn.bind_clearable_fields()
-  $.fn.bind_filter_html_elements()
-  $.fn.bind_button_urls()
+  bind_clearable_fields()
+  bind_filter_html_elements()
+  bind_button_urls()
+  bind_datepicker()
 
   $("[data-counter='true']").bind_counter()
 

        $(this).addClass "open"
        el.show()

$.fn.bind_clearable_fields = ->
  $("[data-clearable-field]").each ->
    input = $(this)
    form = (if input.length > 0 then $(input[0].form) else $())

      else
        $(id).show()

bind_button_urls = ->
  $("[data-button-url]").on "click", ->
    window.location = $(this).data("button-url")
    false

bind_datepicker = ->
  $('.datepicker').datepicker
    format: 'dd.mm.yyyy'
    weekStart: 1

$.fn.bind_counter = ->
  $data = $(this).data()
