destroy recordings table before caching page

This commit is contained in:
Zachary Chai 2016-12-01 15:21:19 -05:00
parent 05a7830cc3
commit 02ea99e8b9
1 changed files with 7 additions and 1 deletions

View File

@ -102,6 +102,9 @@ class @Recordings
}; };
$('#recordings').tooltip(options) $('#recordings').tooltip(options)
$(document).on "turbolinks:before-cache", =>
@getTable().api().clear().draw().destroy()
# enable popovers # enable popovers
options = { options = {
selector: '.has-popover', selector: '.has-popover',
@ -150,7 +153,7 @@ class @Recordings
# setup click handlers for the action buttons # setup click handlers for the action buttons
setupActionHandlers: -> setupActionHandlers: ->
table_api = this.table.api() table_api = this.table.api()
this.table.on 'click', '.recording-update', (event) -> @getTable().on 'click', '.recording-update', (event) ->
btn = $(this) btn = $(this)
row = table_api.row($(this).closest('tr')).data() row = table_api.row($(this).closest('tr')).data()
url = $('.meeting-url').val() url = $('.meeting-url').val()
@ -182,6 +185,9 @@ class @Recordings
btn.prop('disabled', false) btn.prop('disabled', false)
) )
getTable: ->
@table
isOwner: -> isOwner: ->
@owner @owner