Sha256: 914c913cc3d6801eeb4ceb0bc890c1e0cfde8253831585513fbe56972091bd36

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

class CollectionActions
  constructor: (el) ->
    $el  = $(el)

    $el.on 'click', 'a', (e) ->
      e.stopPropagation()
      e.preventDefault()

      url = $(@).attr('href')
      requestType = $(@).data('method')

      # TODO : fetch search form params
      dataParams =  []
      $('.rs:checked').each ->
        dataParams.push($(@).attr('value'))

      if dataParams.length == 0
        alert 'Няма направвен избор'
        return false

      $.ajax(
        url: url
        type: requestType
        data: { selected_ids: dataParams }
      ).fail ->
        alert('Възникна грешка')

Handlers.register 'CollectionActions', CollectionActions

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
manage-1.3.17 app/assets/javascripts/manage/collection_actions.js.coffee