@bbn/bbn 2.0.201 → 2.0.203
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/init.js +7 -3
- package/package.json +1 -1
package/dist/fn/init.js
CHANGED
|
@@ -10,8 +10,11 @@ import isFunction from './type/isFunction.js';
|
|
|
10
10
|
import log from './browser/log.js';
|
|
11
11
|
import timestamp from './datetime/timestamp.js';
|
|
12
12
|
import setupIntl from '../dt/functions/setupIntl.js';
|
|
13
|
-
const
|
|
13
|
+
const onFocus = () => {
|
|
14
14
|
bbn.env.last_focus = bbn.dt().unix();
|
|
15
|
+
};
|
|
16
|
+
const onActivity = (e) => {
|
|
17
|
+
onFocus();
|
|
15
18
|
if (bbn.env.nav !== "ajax") {
|
|
16
19
|
return;
|
|
17
20
|
}
|
|
@@ -35,6 +38,7 @@ const onActivity = (e) => {
|
|
|
35
38
|
target.hasAttribute("href") &&
|
|
36
39
|
!target.hasAttribute("target") &&
|
|
37
40
|
!target.classList.contains("bbn-no")) {
|
|
41
|
+
log("Link clicked: " + target.getAttribute("href"));
|
|
38
42
|
link(target.getAttribute("href"), e);
|
|
39
43
|
}
|
|
40
44
|
};
|
|
@@ -102,8 +106,8 @@ export default function init(cfg, force) {
|
|
|
102
106
|
});
|
|
103
107
|
document.addEventListener("click", onActivity);
|
|
104
108
|
document.addEventListener("keydown", onActivity);
|
|
105
|
-
document.addEventListener("focusin",
|
|
106
|
-
document.addEventListener("focusout",
|
|
109
|
+
document.addEventListener("focusin", onFocus);
|
|
110
|
+
document.addEventListener("focusout", onFocus);
|
|
107
111
|
window.addEventListener("hashchange", () => {
|
|
108
112
|
debugger;
|
|
109
113
|
bbn.env.hashChanged = new Date().getTime();
|