forked from External/greenlight
		
	remove recording from client if 404
This commit is contained in:
		@@ -250,23 +250,27 @@ class @Recordings
 | 
				
			|||||||
        data: data
 | 
					        data: data
 | 
				
			||||||
      }).done((data) ->
 | 
					      }).done((data) ->
 | 
				
			||||||
        btn.prop('disabled', false)
 | 
					        btn.prop('disabled', false)
 | 
				
			||||||
      ).fail((data) ->
 | 
					      ).fail((xhr, text) ->
 | 
				
			||||||
        btn.prop('disabled', false)
 | 
					        btn.prop('disabled', false)
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @getTable().on 'click', '.recording-delete', (event) ->
 | 
					    @getTable().on 'click', '.recording-delete', (event) ->
 | 
				
			||||||
      btn = $(this)
 | 
					      btn = $(this)
 | 
				
			||||||
      row = table_api.row($(this).closest('tr')).data()
 | 
					      row = table_api.row($(this).closest('tr'))
 | 
				
			||||||
      url = recordingsObject.getRecordingsURL()
 | 
					      url = recordingsObject.getRecordingsURL()
 | 
				
			||||||
      id = row.id
 | 
					      id = row.data().id
 | 
				
			||||||
      btn.prop('disabled', true)
 | 
					      btn.prop('disabled', true)
 | 
				
			||||||
      $.ajax({
 | 
					      $.ajax({
 | 
				
			||||||
        method: 'DELETE',
 | 
					        method: 'DELETE',
 | 
				
			||||||
        url: url+'/'+id
 | 
					        url: url+'/'+id
 | 
				
			||||||
      }).done((data) ->
 | 
					      }).done((data) ->
 | 
				
			||||||
        btn.prop('disabled', false)
 | 
					        btn.prop('disabled', false)
 | 
				
			||||||
      ).fail((data) ->
 | 
					      ).fail((xhr, text) ->
 | 
				
			||||||
        btn.prop('disabled', false)
 | 
					        btn.prop('disabled', false)
 | 
				
			||||||
 | 
					        if xhr.status == 404
 | 
				
			||||||
 | 
					          row.remove();
 | 
				
			||||||
 | 
					          recordingsObject.draw()
 | 
				
			||||||
 | 
					          showAlert(I18n.recording_deleted, 4000);
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @getTable().on 'draw.dt', (event) ->
 | 
					    @getTable().on 'draw.dt', (event) ->
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user