File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed
Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 22 * Zones extension (Yozons)
33 */
44
5+ import * as zones from "./lib/zones.js" ;
56import * as section from "./lib/section.js" ;
67import * as story from "./lib/story.js" ;
78
@@ -21,6 +22,9 @@ function distributeZones(locker) {
2122
2223 resolve ( "zones-loaded" )
2324 } ) ;
25+
26+ // Set up the communication bridge
27+ locker . getYozonsLocker ( "zones" ) . changes = zones . changes ;
2428 } ) ;
2529}
2630
Original file line number Diff line number Diff line change 33 * This class handles individual zone elements
44 */
55
6- // Constants for building the vip map and communicating
6+ // Constants for building the vip map
77const map = new Map ( ) ;
8- const changes = new Map ( ) ;
98const fragment = new DocumentFragment ( ) ;
109
10+ // Changes map
11+ export const changes = new Map ( ) ;
12+
1113// Zone class
1214export class Zone {
1315
@@ -231,17 +233,3 @@ export function render() {
231233 map . forEach ( zone => zone . inject ( ) ) ;
232234 window . dispatchEvent ( new Event ( "zones-loaded" ) ) ;
233235}
234-
235- /*
236- * Set up the communication bridge
237- * window.mi.zones isn't available until later
238- * in the page execution
239- */
240-
241- window . addEventListener ( "load" , ( ) => {
242- try {
243- window . mi . zones . changes = changes ;
244- } catch ( e ) {
245- console . warn ( "cannot add changes to the zones object" , e ) ;
246- }
247- } ) ;
You can’t perform that action at this time.
0 commit comments