 
 class LazyAdmin
   constructor: ->
-    @_selection_actions()
+    @_init_selection()
     @_custom_file_input()
     @_locales_tabs()
     @_fileupload()

    $.datepicker.setDefaults(dateFormat: 'dd/mm/yy');
    _init_each_datepicker()


  _selection_actions: ->
    $('form select#selection_action').on 'change', (event) ->
      ids = []
      for obj in $(this.form).serializeArray()
        if obj.name == 'selection[ids][]'
          ids.push obj.value
      if ids.length > 0 and $(this).val().length > 0
        $(this.form).submit()
      else
        $(this).val('')

  _sortable_list: ->
    group = $('.items-list[data-sortable-update]:not(.filtered) .jspPane')

      $(event.currentTarget).parent().toggleClass('opened')

    $(document).on 'append-next-page', (event, content) =>
      all_selected = @all_selected()
      element = $(event.target)
      element.find('.show-more').replaceWith $(content)
      element.foundation()
      @set_main_content_height()
      if all_selected
        $('.items-list input[type=checkbox]').each (idx, el) ->
          $(el)
            .prop('checked', true)
            .trigger('change', [true])
        @selection_changed()


    @_sortable_list()


  set_main_content_height: ->
    _height = $(window).innerHeight() - $('header.panel-header').outerHeight()
