web-manager 3.2.59 → 3.2.61

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
@@ -488,9 +488,6 @@ Manager.prototype.init = function(configuration, callback) {
488
488
  initChecks: {
489
489
  features: [], // an array of javascript and dom features to check for (NIY)
490
490
  },
491
- refreshNewVersion: {
492
- enabled: true,
493
- },
494
491
  auth: {
495
492
  state: 'default', // required, prohibited, default
496
493
  sends: {
@@ -498,6 +495,9 @@ Manager.prototype.init = function(configuration, callback) {
498
495
  prohibited: '/',
499
496
  },
500
497
  },
498
+ refreshNewVersion: {
499
+ enabled: true,
500
+ },
501
501
  exitPopup: {
502
502
  enabled: true,
503
503
  config: {
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/lib/utilities.js CHANGED
@@ -144,4 +144,19 @@ Utilities.getContext = function () {
144
144
  }
145
145
  }
146
146
 
147
+ // Navigate fn that takes a url and an object of query params
148
+ Utilities.navigate = function (url, params) {
149
+ // Should work if the url is a relative path too
150
+ var newUrl = new URL(url, window.location.origin);
151
+
152
+ // Add the params to the url
153
+ Object.keys(params).forEach(function (key) {
154
+ newUrl.searchParams.set(key, params[key]);
155
+ });
156
+
157
+ // Navigate to the new url
158
+ window.location.href = newUrl;
159
+ }
160
+
161
+
147
162
  module.exports = Utilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.59",
3
+ "version": "3.2.61",
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": {