web-manager 3.2.58 → 3.2.60
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +5 -4
- package/lib/account.js +13 -4
- package/lib/dom.js +7 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -470,7 +470,8 @@ Manager.prototype.init = function(configuration, callback) {
|
|
470
470
|
// Load polyfills
|
471
471
|
init_loadPolyfills(self, configuration, function() {
|
472
472
|
self.properties.page.status.initializing = false;
|
473
|
-
|
473
|
+
|
474
|
+
// set options
|
474
475
|
var options_defaults = {
|
475
476
|
// debug: {
|
476
477
|
// environment: self.properties.meta.environment,
|
@@ -487,9 +488,6 @@ Manager.prototype.init = function(configuration, callback) {
|
|
487
488
|
initChecks: {
|
488
489
|
features: [], // an array of javascript and dom features to check for (NIY)
|
489
490
|
},
|
490
|
-
refreshNewVersion: {
|
491
|
-
enabled: true,
|
492
|
-
},
|
493
491
|
auth: {
|
494
492
|
state: 'default', // required, prohibited, default
|
495
493
|
sends: {
|
@@ -497,6 +495,9 @@ Manager.prototype.init = function(configuration, callback) {
|
|
497
495
|
prohibited: '/',
|
498
496
|
},
|
499
497
|
},
|
498
|
+
refreshNewVersion: {
|
499
|
+
enabled: true,
|
500
|
+
},
|
500
501
|
exitPopup: {
|
501
502
|
enabled: true,
|
502
503
|
config: {
|
package/lib/account.js
CHANGED
@@ -7,17 +7,26 @@ function Account(init) {
|
|
7
7
|
self.properties = {};
|
8
8
|
self.accountPageInitialized = false;
|
9
9
|
|
10
|
+
// Initialize libraries
|
10
11
|
try {
|
11
12
|
self.dom = init.dom || self.Manager.dom();
|
12
13
|
self.utilities = init.utilities || self.Manager.utilities();
|
14
|
+
} catch (e) {
|
15
|
+
console.error('Failed to initialize libraries');
|
16
|
+
}
|
13
17
|
|
14
|
-
|
18
|
+
// Initialize account page
|
19
|
+
try {
|
20
|
+
// If we're NOT in the browser, skip
|
21
|
+
if (typeof window !== 'undefined') {
|
22
|
+
var url = new URL(window.location.href);
|
15
23
|
|
16
|
-
|
17
|
-
|
24
|
+
if (url.pathname.startsWith('/account')) {
|
25
|
+
self.initializeAccountPage();
|
26
|
+
}
|
18
27
|
}
|
19
28
|
} catch (e) {
|
20
|
-
console.error('Failed to initialize
|
29
|
+
console.error('Failed to initialize account page');
|
21
30
|
}
|
22
31
|
}
|
23
32
|
|
package/lib/dom.js
CHANGED
@@ -319,6 +319,13 @@ Dom.select = function(selector, options) {
|
|
319
319
|
});
|
320
320
|
}
|
321
321
|
|
322
|
+
Dom.onDocumentReady = function(fn) {
|
323
|
+
if (['complete', 'interactive'].includes(document.readyState)) {
|
324
|
+
fn();
|
325
|
+
} else {
|
326
|
+
document.addEventListener('DOMContentLoaded', fn);
|
327
|
+
}
|
328
|
+
}
|
322
329
|
|
323
330
|
Dom.prototype.parent = function(selector) {
|
324
331
|
var elsObj = Object.assign({}, this.elements);
|
package/package.json
CHANGED