@bbn/bbn 1.0.352 → 1.0.353

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/dist/env.js CHANGED
@@ -34,7 +34,7 @@ export default {
34
34
  hashChanged: 0,
35
35
  params: [],
36
36
  isInit: false,
37
- isFocused: false,
37
+ isFocused: true,
38
38
  timeoff: Math.round((new Date()).getTime() / 1000),
39
39
  loggingLevel: 5,
40
40
  ignoreUnload: false,
package/dist/fn/init.js CHANGED
@@ -93,7 +93,16 @@ export default function init(cfg, force) {
93
93
  dayjs.locale(bbn.env.lang);
94
94
  });
95
95
  }
96
+ document.addEventListener("visibilitychange", function () {
97
+ if (document.hidden && bbn.env.isFocused) {
98
+ bbn.env.isFocused = false;
99
+ }
100
+ else if (!document.hidden && !bbn.env.isFocused) {
101
+ bbn.env.isFocused = true;
102
+ }
103
+ });
96
104
  document.addEventListener("focusin", function (e) {
105
+ bbn.fn.log("FOCUS IN", e);
97
106
  if (e.target instanceof HTMLElement &&
98
107
  !e.target.classList.contains("bbn-no")) {
99
108
  bbn.env.focused = e.target;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.352",
3
+ "version": "1.0.353",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",