MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / finish

Function finish

lib/web/lazyload/lazyload.js:93–113  ·  view source on GitHub ↗

Called when the current pending resource of the specified type has finished loading. Executes the associated callback (if any) and loads the next resource in the queue. @method finish @param {String} type resource type ('css' or 'js') @private

(type)

Source from the content-addressed store, hash-verified

91 @private
92 */
93 function finish(type) {
94 var p = pending[type],
95 callback,
96 urls;
97
98 if (p) {
99 callback = p.callback;
100 urls = p.urls;
101
102 urls.shift();
103 pollCount = 0;
104
105 // If this is the last of the pending URLs, execute the callback and
106 // start the next request in the queue (if any).
107 if (!urls.length) {
108 callback && callback.call(p.context, p.obj);
109 pending[type] = null;
110 queue[type].length && load(type);
111 }
112 }
113 }
114
115 /**
116 Populates the <code>env</code> variable with user agent and feature test

Callers 3

_finishFunction · 0.85
pollGeckoFunction · 0.85
pollWebKitFunction · 0.85

Calls 2

loadFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected