Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch for bug with jquery-ui-tabs api when <head> has a <base href> tag. http://bugs.jqueryui.com/ticket/4941 http://bugs.jqueryui.com/ticket/8637
//this is to patch a bug with the jquery.ui.tabs API
// http://bugs.jqueryui.com/ticket/4941
// http://bugs.jqueryui.com/ticket/8637
// it has to do with the <base href> tag in <head> and jquery.ui.tabs
// being smart about figuring out weather to AJAX a tab or not
;(function() {
var tabsInitialised = false;
var _tabs = $.fn.tabs;
var updateBaseHrefs = function() {
var base = location.href.replace(/#.*$/, '');
$('[data-jquery-ui-local]=true').each(function () {
var href = $(this).attr('href');
$(this).attr('href', base + href);
});
tabsInitialised = true;
};
$.fn.tabs = function() {
if (!tabsInitialised) updateBaseHrefs();
return _tabs.apply(this, arguments);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.