web-manager 3.2.25 → 3.2.27

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.
Files changed (2) hide show
  1. package/lib/account.js +17 -8
  2. package/package.json +1 -1
package/lib/account.js CHANGED
@@ -106,6 +106,8 @@ Account.prototype.resolve = function (account, options) {
106
106
  options = options || {};
107
107
  options.fetchNewAccount = typeof options.fetchNewAccount === 'undefined' ? true : options.fetchNewAccount;
108
108
 
109
+ console.log('account.resolve():', currentUser, options);
110
+
109
111
  // If there is no user logged in or we choose not to fetch the account, resolve a default account
110
112
  if (!currentUser || !currentUser.uid || !options.fetchNewAccount) {
111
113
  return resolve(
@@ -147,17 +149,22 @@ Account.prototype.handleAccount = function (account) {
147
149
  }
148
150
 
149
151
  function handlePlanVisibility(planId) {
150
- var elements = document.querySelectorAll('[data-plan-id]');
152
+ var elements = document.querySelectorAll('[data-plan-id][data-plan-visibility]');
153
+
154
+ // Log
155
+ console.log('account.handlePlanVisibility(): planId', planId);
156
+ console.log('account.handlePlanVisibility(): elements', elements);
151
157
 
152
158
  // Initially hide all elements
153
- elements.forEach(function(element) {
154
- element.setAttribute('hidden', true);
159
+ elements.forEach(function($el) {
160
+ $el.setAttribute('hidden', true);
161
+ console.log('account.handlePlanVisibility(): hiding', $el);
155
162
  });
156
163
 
157
164
  // 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';
165
+ elements.forEach(function($el) {
166
+ var requiredPlans = $el.getAttribute('data-plan-id').split(',');
167
+ var visibility = $el.getAttribute('data-plan-visibility') || 'visible';
161
168
 
162
169
  var shouldBeVisible = false;
163
170
 
@@ -172,10 +179,12 @@ function handlePlanVisibility(planId) {
172
179
  ? visibility === 'hidden'
173
180
  : visibility === 'visible';
174
181
 
182
+ console.log('account.handlePlanVisibility(): setting', shouldHide, $el);
183
+
175
184
  if (shouldHide) {
176
- element.setAttribute('hidden', true);
185
+ $el.setAttribute('hidden', true);
177
186
  } else {
178
- element.removeAttribute('hidden');
187
+ $el.removeAttribute('hidden');
179
188
  }
180
189
  });
181
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.25",
3
+ "version": "3.2.27",
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": {