sfc-utils 1.4.154 → 1.4.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nav2.js +25 -3
- package/package.json +1 -1
package/nav2.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
let { getBrands3 } = require("./brands3");
|
|
2
2
|
|
|
3
3
|
// Handle nav for various markets and include nav options for other links
|
|
4
|
-
let getNav2 = function (
|
|
4
|
+
let getNav2 = function (
|
|
5
|
+
meta,
|
|
6
|
+
urlAdd,
|
|
7
|
+
forceColor,
|
|
8
|
+
navLink,
|
|
9
|
+
navArray,
|
|
10
|
+
overrides
|
|
11
|
+
) {
|
|
5
12
|
// If we aren't passing meta in, we have to call getSettings here
|
|
6
13
|
if (!meta) {
|
|
7
14
|
let { getSettings } = require("./settings");
|
|
@@ -123,6 +130,21 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
123
130
|
subfolder = meta.PROJECT.SUBFOLDER + "/";
|
|
124
131
|
}
|
|
125
132
|
|
|
133
|
+
// Handle overrides assignment
|
|
134
|
+
let desktopIcon = `https://files.sfchronicle.com/static-assets/logos/${marketPrefix}-${color}.png`;
|
|
135
|
+
let mobileIcon = `https://files.sfchronicle.com/static-assets/logos/${marketPrefix}-square-${color}.png`;
|
|
136
|
+
if (overrides) {
|
|
137
|
+
if (overrides.desktopIcon) {
|
|
138
|
+
desktopIcon = overrides.desktopIcon;
|
|
139
|
+
}
|
|
140
|
+
if (overrides.mobileIcon) {
|
|
141
|
+
mobileIcon = overrides.mobileIcon;
|
|
142
|
+
}
|
|
143
|
+
if (overrides.subscribeLink) {
|
|
144
|
+
subscribeLink = overrides.subscribeLink;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
126
148
|
// If a link object was provided, format the insert
|
|
127
149
|
let navLinkInsert = "";
|
|
128
150
|
if (navLink && navLink.url !== "") {
|
|
@@ -167,12 +189,12 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
167
189
|
<img
|
|
168
190
|
class="nav2-desk-logo"
|
|
169
191
|
alt="Logo"
|
|
170
|
-
src="
|
|
192
|
+
src="${desktopIcon}"
|
|
171
193
|
/>
|
|
172
194
|
<img
|
|
173
195
|
class="nav2-mobile-logo"
|
|
174
196
|
alt="Logo"
|
|
175
|
-
src="
|
|
197
|
+
src="${mobileIcon}"
|
|
176
198
|
/>
|
|
177
199
|
</div>
|
|
178
200
|
</a>
|