web-manager 3.2.25 → 3.2.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/account.js +15 -8
  2. package/package.json +1 -1
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.25",
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": {