web-manager 3.2.24 → 3.2.26

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/index.js CHANGED
@@ -1015,7 +1015,13 @@ function Manager() {
1015
1015
  HELPERS
1016
1016
  */
1017
1017
  function subscriptionManager(self, options_user) {
1018
- if (!('serviceWorker' in navigator) || !(typeof firebase.messaging !== 'undefined')) {return}
1018
+ if (
1019
+ !('serviceWorker' in navigator)
1020
+ || (typeof firebase === 'undefined')
1021
+ || (typeof firebase.messaging === 'undefined')
1022
+ ) {
1023
+ return
1024
+ }
1019
1025
 
1020
1026
  // service worker guide: https://developers.google.com/web/updates/2018/06/fresher-sw
1021
1027
  navigator.serviceWorker.register(
package/lib/account.js CHANGED
@@ -147,17 +147,22 @@ Account.prototype.handleAccount = function (account) {
147
147
  }
148
148
 
149
149
  function handlePlanVisibility(planId) {
150
- var elements = document.querySelectorAll('[data-plan-id]');
150
+ var elements = document.querySelectorAll('[data-plan-id][data-plan-visibility]');
151
+
152
+ // Log
153
+ console.log('handlePlanVisibility(): planId', planId);
154
+ console.log('handlePlanVisibility(): elements', elements);
151
155
 
152
156
  // Initially hide all elements
153
- elements.forEach(function(element) {
154
- element.setAttribute('hidden', true);
157
+ elements.forEach(function($el) {
158
+ $el.setAttribute('hidden', true);
159
+ console.log('handlePlanVisibility(): hiding', $el);
155
160
  });
156
161
 
157
162
  // Toggle visibility based on plan
158
- elements.forEach(function(element) {
159
- var requiredPlans = element.getAttribute('data-plan-id').split(',');
160
- var visibility = element.getAttribute('data-plan-visibility') || 'visible';
163
+ elements.forEach(function($el) {
164
+ var requiredPlans = $el.getAttribute('data-plan-id').split(',');
165
+ var visibility = $el.getAttribute('data-plan-visibility') || 'visible';
161
166
 
162
167
  var shouldBeVisible = false;
163
168
 
@@ -172,10 +177,12 @@ function handlePlanVisibility(planId) {
172
177
  ? visibility === 'hidden'
173
178
  : visibility === 'visible';
174
179
 
180
+ console.log('handlePlanVisibility(): setting', shouldHide, $el);
181
+
175
182
  if (shouldHide) {
176
- element.setAttribute('hidden', true);
183
+ $el.setAttribute('hidden', true);
177
184
  } else {
178
- element.removeAttribute('hidden');
185
+ $el.removeAttribute('hidden');
179
186
  }
180
187
  });
181
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.24",
3
+ "version": "3.2.26",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {