bhl-forms 0.1.20 → 0.1.22
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/bhl-forms.es.js +18 -0
- package/dist/bhl-forms.iife.js +6 -6
- package/dist/bhl-forms.modern.es.js +18 -0
- package/dist/bhl-forms.modern.iife.js +5 -5
- package/dist/bhl-forms.modern.umd.js +5 -5
- package/dist/bhl-forms.umd.js +6 -6
- package/dist/forms/appraisals.es.js +5 -1
- package/dist/forms/appraisals.iife.js +1 -1
- package/dist/forms/appraisals.json +1 -1
- package/dist/forms/coins.es.js +5 -1
- package/dist/forms/coins.iife.js +1 -1
- package/dist/forms/coins.json +1 -1
- package/dist/forms/mechanics.es.js +5 -1
- package/dist/forms/mechanics.iife.js +1 -1
- package/dist/forms/mechanics.json +1 -1
- package/package.json +2 -2
package/dist/bhl-forms.es.js
CHANGED
|
@@ -11274,7 +11274,25 @@ function getCoords(elem) {
|
|
|
11274
11274
|
left: box2.left + window.pageXOffset
|
|
11275
11275
|
};
|
|
11276
11276
|
}
|
|
11277
|
+
function formVisible(formNode) {
|
|
11278
|
+
const form2 = document.getElementById(formNode.id);
|
|
11279
|
+
if (!form2) {
|
|
11280
|
+
return false;
|
|
11281
|
+
}
|
|
11282
|
+
let box2 = form2.getBoundingClientRect();
|
|
11283
|
+
if (box2.top < 0) {
|
|
11284
|
+
return false;
|
|
11285
|
+
}
|
|
11286
|
+
if (box2.bottom > (window.innerHeight || 0)) {
|
|
11287
|
+
return false;
|
|
11288
|
+
}
|
|
11289
|
+
return true;
|
|
11290
|
+
}
|
|
11277
11291
|
const scrollAnchor = (formNode) => () => {
|
|
11292
|
+
if (formVisible(formNode)) {
|
|
11293
|
+
dbg("form is visible, not scrolling");
|
|
11294
|
+
return;
|
|
11295
|
+
}
|
|
11278
11296
|
const anchorId = formNode.attrs.anchorElement || formNode.id;
|
|
11279
11297
|
if (anchorId) {
|
|
11280
11298
|
const anchor = document.getElementById(anchorId);
|