Added query string parameter 'tab' to select active tab on loading.

This commit is contained in:
Kasper D. Fischer 2014-09-23 15:53:05 +00:00
parent c30e7ad781
commit 2843c584a9
Notes: subgit 2018-03-07 17:59:06 +01:00
r763 www/trunk

View File

@ -131,6 +131,11 @@ var config = {
},
networkBlacklist: ['NL', 'X5'],
},
tab: {
active: 0,
disabled: [2],
max: 4,
},
};
var networkURL = {
GE: 'http://dx.doi.org/10.14470/TR560404',
@ -175,6 +180,11 @@ $(document).ready(function() {
if ( Number(parameters['timespan']) ) {
config['map']['timespan'] = Number(parameters['timespan']);
};
if ( Number(parameters['tab']) ) {
if ( Number(parameters['tab']) < config['tab']['max'] ) {
config['tab']['active'] = Number(parameters['tab']);
};
};
// AJAX setup
$.ajaxSetup({timeout: config['ajax']['timeout']});
@ -184,8 +194,8 @@ $(document).ready(function() {
// create tabs
$('#tabs').tabs({
active: 0,
disabled: [2],
active: config['tab']['active'],
disabled: config['tab']['disabled'],
activate: function( event, ui ) { ui['newPanel'].find('table').trigger("update", [true]); },
});
// create accordions