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.
- package/lib/account.js +15 -8
- 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(
|
154
|
-
|
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(
|
159
|
-
var requiredPlans =
|
160
|
-
var visibility =
|
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
|
-
|
183
|
+
$el.setAttribute('hidden', true);
|
177
184
|
} else {
|
178
|
-
|
185
|
+
$el.removeAttribute('hidden');
|
179
186
|
}
|
180
187
|
});
|
181
188
|
}
|
package/package.json
CHANGED