Skip to content

Commit 4948046

Browse files
authored
Merge pull request #27 from mcclatchy/mi-zone-fix
ensuring mi.zones isn't clobbered
2 parents ec2da01 + 966f477 commit 4948046

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

demo/story/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
<link rel="stylesheet" href="/demo/demo.css">
1616

1717
<script type="module">
18+
window.mi = {
19+
zones: {
20+
test: "performance"
21+
}
22+
}
23+
1824
import locker from "../locker.js";
1925
import distributeZones from "/index.js";
2026

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ async function distributeZones(locker) {
2525

2626
// Add the communication bridge
2727
window.mi = window.mi || {};
28-
window.mi.zones = zones.getPublicAPI();
28+
window.mi.zones = window.mi.zones || {};
29+
window.mi.zones = Object.assign(window.mi.zones, zones.getPublicAPI());
2930

3031
// Give the performance team a promise
3132
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)