WebUI: Load properties tabs once

Don't reload HTML on tab change. Load the entire structure once and
keep the unused bits hidden.

Keep also the JS code separately, one file per tab.

NOTE: tabs content is not loaded. This will be fixed in the next commit.
This commit is contained in:
Gabriele 2014-12-08 21:00:00 +01:00
parent cb9ed13d69
commit c54271638b
10 changed files with 654 additions and 647 deletions

View file

@ -311,11 +311,33 @@ window.addEvent('load', function () {
bottom : 0,
left : 0
},
contentURL : 'prop-general.html',
contentURL : 'properties_content.html',
require : {
css : ['css/Tabs.css']
css : ['css/Tabs.css'],
js : ['scripts/prop-general.js', 'scripts/prop-trackers.js', 'scripts/prop-files.js'],
},
tabsURL : 'properties.html',
tabsOnload : function() {
MochaUI.initializeTabs('propertiesTabs');
$('PropGeneralLink').addEvent('click', function(e){
$('prop_general').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_files').addClass("invisible");
});
$('PropTrackersLink').addEvent('click', function(e){
$('prop_trackers').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_files').addClass("invisible");
});
$('PropFilesLink').addEvent('click', function(e){
$('prop_files').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
});
},
column : 'mainColumn',
height : prop_h
});