Is there a way to reload the selected tab I know there is the .load() function. But it wants a tab index and I don\'t seem to see a way to grab the selected tabs id.
I managed to get this to work but it now loads the first tab twice when it isn't active. If anyone has any more advice on this that would be much appreciated.
You can see above that the request is made twice to the server but the first request is successful so it cancels the second. Not sure if this is an issue or not..? But Im not being reassured by seeing it in the console
constructor: (@element) ->
@tabIndex = 0
@tabs = @element.find('#tabs')
@tabs.tabs
spinner: "Loading.."
cache: false
ajaxOptions:
cache: false
error: ( xhr, status, index, anchor ) ->
$( anchor.hash ).html "Couldn't load this tab. We'll try to fix this as soon as possible."
#add custom load to make sure they always reload even the current tab when clicked
@element.find('ul li a').click (e) =>
if @tabIndex is @tabs.tabs('option', 'selected')
@tabs.tabs 'load', @tabs.tabs('option', 'selected')
@tabIndex = @tabs.tabs('option', 'selected')