mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Browsable API tab preferences should be site-wide
This commit is contained in:
parent
cba972911a
commit
f3ab0b2b1d
|
@ -36,12 +36,12 @@ $('a[data-toggle="tab"]:not(:first)').on('shown', function (e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a[data-toggle="tab"]').click(function(){
|
$('a[data-toggle="tab"]').click(function(){
|
||||||
document.cookie="tab=" + this.name;
|
document.cookie="tabstyle=" + this.name + "; path=/";
|
||||||
});
|
});
|
||||||
|
|
||||||
// Store tab preference in cookies & display appropriate tab on load.
|
// Store tab preference in cookies & display appropriate tab on load.
|
||||||
var selectedTab = null;
|
var selectedTab = null;
|
||||||
var selectedTabName = getCookie('tab');
|
var selectedTabName = getCookie('tabstyle');
|
||||||
|
|
||||||
if (selectedTabName) {
|
if (selectedTabName) {
|
||||||
selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
|
selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user