-
Notifications
You must be signed in to change notification settings - Fork 36
/
gatsby-browser.js
74 lines (64 loc) · 2.08 KB
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import 'bootstrap/dist/css/bootstrap.min.css';
import 'jquery/dist/jquery.min';
import 'popper.js/dist/popper.min';
import 'bootstrap/dist/js/bootstrap.min';
import './styles/config/print.css';
import './styles/styles.scss';
import $ from 'jquery';
import 'jquery.scrollto';
export const onClientEntry = () => {
if (!window.location.hash) {
window.scrollTo(0, 0);
} else {
// Race condition with default browser behavior for deep links.
setTimeout(() => {
$.scrollTo($(window.location.hash), {
offset: { top: -80 }
});
}, 1000)
}
(() => {
function OptanonWrapper() { } // eslint-disable-line no-unused-vars
let initializedForm = false;
const loadForm = () => {
if (initializedForm === false) {
initializedForm = true;
window.MktoForms2.loadForm('//pages.getpostman.com', '067-UMD-991', 1376);
}
};
const s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//pages.getpostman.com/js/forms2/js/forms2.min.js';
s.onreadystatechange = () => {
if (this.readyState === 'complete' || this.readyState === 'loaded') {
loadForm();
}
};
s.onload = loadForm;
document.getElementsByTagName('head')[0].appendChild(s);
})();
}
// exports.onClientEntry = () => {
// (() => {
// function OptanonWrapper() { } // eslint-disable-line no-unused-vars
// let initializedForm = false;
// const loadForm = () => {
// if (initializedForm === false) {
// initializedForm = true;
// window.MktoForms2.loadForm('//pages.getpostman.com', '067-UMD-991', 1376);
// }
// };
// const s = document.createElement('script');
// s.type = 'text/javascript';
// s.async = true;
// s.src = '//pages.getpostman.com/js/forms2/js/forms2.min.js';
// s.onreadystatechange = () => {
// if (this.readyState === 'complete' || this.readyState === 'loaded') {
// loadForm();
// }
// };
// s.onload = loadForm;
// document.getElementsByTagName('head')[0].appendChild(s);
// })();
// };