Merge pull request #62 from zach-chai/caching_fix

destroy recordings table before caching page
This commit is contained in:
Zachary Chai 2016-12-01 15:38:02 -05:00 committed by GitHub
commit 41c9e7798f
1 changed files with 7 additions and 1 deletions

View File

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