Skip to content

Commit d37af8f

Browse files
committed
fixed the window.id issue in the embed code as well (and made a note about it with the original patch)
1 parent d8aa96a commit d37af8f

4 files changed

+12
-9
lines changed

Diff for: lightningjs-bootstrap.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ window.lightningjs || (function(window, parentLightningjs){
4646
parentLoadPendingIdLookup = {},
4747
parentLoaded = false;
4848

49+
// this is a workaround for potential issue when window.id was set
50+
// in older versions of the embed code
4951
if(deferredApiCalls && deferredApiCalls[0]) {
5052
var promiseFunctionId = deferredApiCalls[0][1];
5153
responses[promiseFunctionId] = api;
5254
}
53-
55+
5456
// NOTE: root.lv contains the embed version
5557
api._load = function() {
5658
// this method gets called whenever the parent.window.onload event fires

Diff for: lightningjs-bootstrap.min.js

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lightningjs-embed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ window.lightningjs || (function(modules){
2424
// (used to deserialize the callstack with proper dependency
2525
// ordering later on)
2626
promiseResponseId = ++responseCounter,
27-
promiseFunctionId = context ? (context.id || 0) : 0;
27+
promiseFunctionId = (context && context != theWindow) ? (context.id || 0) : 0;
2828

2929
// push this call onto the callstack
3030
(internalModule.s = internalModule.s || []).push([promiseResponseId, promiseFunctionId, theArguments]);

Diff for: lightningjs-embed.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)