cirandas.net

ref: master

plugins/custom_routes/public/js/custom_routes.js


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
$(document).ready(function() {

  $('#custom-routes').on('click', 'tr a.icon-remove', function () {
    var tableRow = $(this).closest('tr')
    var routeId = $(this).data('id')
    tableRow.addClass('loading')

    $.post($(this).attr('href'), { route_id: routeId })
    .done(function(response) {
      tableRow.remove()
    }).fail(function(response) {
      tableRow.removeClass('loading')
      display_notice(response.responseJSON['msg'])
    })

    return false
  })

})