added delayed dss for testing
This commit is contained in:
parent
f0918dce75
commit
b09a5f0906
|
@ -118,6 +118,7 @@
|
||||||
percentage: true,
|
percentage: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
delayDss: false, // TODO: move to cache type options
|
||||||
},
|
},
|
||||||
cache: {
|
cache: {
|
||||||
meta: null,
|
meta: null,
|
||||||
|
@ -133,6 +134,12 @@
|
||||||
*/
|
*/
|
||||||
var cacheDB = null;
|
var cacheDB = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use delayed fetch
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
var delayedResources = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The factory which contains detection helpers and cache backend builders.
|
* The factory which contains detection helpers and cache backend builders.
|
||||||
*/
|
*/
|
||||||
|
@ -585,7 +592,13 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var loadResource = function (resource, cb) {
|
var loadResource = function (resource, cb, loadDelayed) {
|
||||||
|
if (options.loader.delayDss === true && resource.type === 'css' && loadDelayed === undefined) {
|
||||||
|
utilDebug('loadResource delay '+JSON.stringify(resource));
|
||||||
|
delayedResources.push(resource);
|
||||||
|
return cb(null);
|
||||||
|
}
|
||||||
|
|
||||||
var resourceUrl = resource.url;
|
var resourceUrl = resource.url;
|
||||||
if (resourceUrl.indexOf('http') === -1) {
|
if (resourceUrl.indexOf('http') === -1) {
|
||||||
resourceUrl = options.server.url + resourceUrl;
|
resourceUrl = options.server.url + resourceUrl;
|
||||||
|
@ -996,6 +1009,18 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var loadDelayedResouces = function() {
|
||||||
|
if (delayedResources.length === 0) {
|
||||||
|
return; // nop
|
||||||
|
}
|
||||||
|
var loadResourceStep = function (resource, cb) {
|
||||||
|
loadResource(resource,cb, true);
|
||||||
|
};
|
||||||
|
utilRunStack('loadResources', delayedResources, loadResourceStep , function (/*err*/) {
|
||||||
|
//cb(err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the loader.
|
* Starts the loader.
|
||||||
*
|
*
|
||||||
|
@ -1011,6 +1036,7 @@
|
||||||
bootCleanup(); // move after ang.
|
bootCleanup(); // move after ang.
|
||||||
bootAngular(function(err) {
|
bootAngular(function(err) {
|
||||||
if (err !== null) { return options.error.handler(err); }
|
if (err !== null) { return options.error.handler(err); }
|
||||||
|
loadDelayedResouces();
|
||||||
if (typeof cbArgu === 'function') {
|
if (typeof cbArgu === 'function') {
|
||||||
cbArgu();
|
cbArgu();
|
||||||
}
|
}
|
||||||
|
@ -1107,8 +1133,6 @@
|
||||||
/**
|
/**
|
||||||
* Boot cleanup removed the html tags by id after the timeout.
|
* Boot cleanup removed the html tags by id after the timeout.
|
||||||
*
|
*
|
||||||
* note: sync function
|
|
||||||
*
|
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
var bootCleanup = function() {
|
var bootCleanup = function() {
|
||||||
|
@ -1122,7 +1146,6 @@
|
||||||
}
|
}
|
||||||
utilDebug('bootCleanup after '+options.boot.cleanup.timeout+' ms.');
|
utilDebug('bootCleanup after '+options.boot.cleanup.timeout+' ms.');
|
||||||
setTimeout ( function () {
|
setTimeout ( function () {
|
||||||
utilDebug('bootCleanup run');
|
|
||||||
for (var tagIdx in options.boot.cleanup.tags) {
|
for (var tagIdx in options.boot.cleanup.tags) {
|
||||||
var tagId = options.boot.cleanup.tags[tagIdx];
|
var tagId = options.boot.cleanup.tags[tagIdx];
|
||||||
var tag = document.getElementById(tagId);
|
var tag = document.getElementById(tagId);
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
<body>
|
<body>
|
||||||
<script id="ffCleanupScript"><%- inlineScript %></script>
|
<script id="ffCleanupScript"><%- inlineScript %></script>
|
||||||
<script id="ffCleanupConfig">
|
<script id="ffCleanupConfig">
|
||||||
//FFSpaLoader.options.cache.css = false;
|
|
||||||
//FFSpaLoader.options.cache.dss = false;
|
|
||||||
FFSpaLoader.options.debug.enable = true;
|
FFSpaLoader.options.debug.enable = true;
|
||||||
FFSpaLoader.options.boot.angular.modules.push('exampleUI');
|
FFSpaLoader.options.boot.angular.modules.push('exampleUI');
|
||||||
FFSpaLoader.options.boot.cleanup.tags.push('ffCleanupCss');
|
FFSpaLoader.options.boot.cleanup.tags.push('ffCleanupCss');
|
||||||
|
|
Loading…
Reference in a new issue