Fix lazy tab loading
[?]
Sep 21, 2013, 5:25 PM
6Q2JPSWGL4KKQEBYB3TNZIHAFHGOA47OH7MQM3RMKM72HIZSFCAQCDependencies
- [2]
2P7VNAACMove common Javascript code into a separate file - [3]
2G63HKCHFix some wellformedness issues - [4]
BIVZGPUTOptimise clickable rows - [5]
RDSPL26CLoad a tab only once - [6]
YPDYBK5GShow dependencies as a tree rather than a list - [7]
OIBSCXGIUse a popover to show how to use the build reproduction script - [8]
4XVYHFDLShow an error message if tab loading fails - [9]
QCGCX2BRGeneralize lazy tabs - [*]
IK53RV4V
Change contents
- replacement in src/root/common.tt at line 462[4.388]→[4.388:407](∅→∅),[4.407]→[4.0:27](∅→∅),[4.27]→[4.407:542](∅→∅),[4.407]→[4.407:542](∅→∅),[4.542]→[3.705:770](∅→∅),[3.770]→[4.85:115](∅→∅),[4.85]→[4.85:115](∅→∅),[4.115]→[4.0:288](∅→∅),[4.580]→[4.0:288](∅→∅),[4.288]→[4.629:657](∅→∅),[4.629]→[4.629:657](∅→∅)
$(function() {var tabsLoaded = {};$('.nav-tabs').bind('show', function(e) {var pattern = /#.+/gi;var id = e.target.toString().match(pattern)[0];if (id == "#[% tabName %]" && !tabsLoaded[id]) {tabsLoaded[id] = 1;$('#[% tabName %]').load("[% uri %]", function(response, status, xhr) {if (status == "error") {$('#[% tabName %]').html("<div class='alert alert-error'>Error loading tab: " + xhr.status + " " + xhr.statusText + "</div>");}});}});});$(function() { makeLazyTab("[% tabName %]", "[% uri %]"); }); - edit in src/root/static/js/common.js at line 74[2.2155]
var tabsLoaded = {};var makeLazyTab = function(tabName, uri) {$('.nav-tabs').bind('show', function(e) {var pattern = /#.+/gi;var id = e.target.toString().match(pattern)[0];if (id == '#' + tabName && !tabsLoaded[id]) {tabsLoaded[id] = 1;$('#' + tabName).load(uri, function(response, status, xhr) {if (status == "error") {$('#' + tabName).html("<div class='alert alert-error'>Error loading tab: " + xhr.status + " " + xhr.statusText + "</div>");}});}});}