Skip to content

Commit e4341f2

Browse files
committed
Merge branch 'develop'
2 parents 28c9c97 + 9f99ee3 commit e4341f2

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import * as zones from "./lib/zones.js";
66
import * as section from "./lib/section.js";
77
import * as story from "./lib/story.js";
8+
import * as homepage from "./lib/homepage.js";
89

910
function distributeZones(locker) {
1011
// Add the communication bridge and vip method to the zones API
@@ -21,6 +22,9 @@ function distributeZones(locker) {
2122
case "story":
2223
story.render(locker);
2324
break;
25+
case "homepage":
26+
homepage.render(locker);
27+
break;
2428
default:
2529
reject("not a matching page type");
2630
}

lib/homepage.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Homepage template
3+
*
4+
* Note:
5+
* The DOM has not been updated to the grid yet, so this is
6+
* a manual set up for now.
7+
*/
8+
9+
import * as zones from "./zones.js";
10+
11+
export function render(locker) {
12+
// Locker configs
13+
const market = locker.getConfig("marketInfo.domain");
14+
15+
// Community Events (iPublish)
16+
if(locker.getConfig("zone.communityEvents")) {
17+
const ipublish = zones.get("zone-community-events");
18+
ipublish.style.padding = 0;
19+
ipublish.dataset.market = market;
20+
ipublish.zephr("zone-community-events", market)
21+
ipublish.vip = document.querySelector("#zone-el-5");
22+
ipublish.inject();
23+
}
24+
}

lib/zones.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ export class Zone {
6565
return this.element.dataset;
6666
}
6767

68+
/*
69+
* Getter to work with the element style object
70+
*/
71+
72+
get style() {
73+
return this.element.style;
74+
}
75+
6876
/*
6977
* Zephr feature functionality
7078
* @param feature {string} the feature slug in Zephr

0 commit comments

Comments
 (0)