frayerjj-frontend 0.3.2 → 0.3.4
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/package.json +1 -1
- package/src/init.js +16 -14
- package/src/modal.js +1 -1
package/package.json
CHANGED
package/src/init.js
CHANGED
|
@@ -125,20 +125,22 @@ export const init = () => {
|
|
|
125
125
|
|
|
126
126
|
// Scroll to top button
|
|
127
127
|
let toTop = document.getElementById('toTopBtn');
|
|
128
|
-
toTop
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
128
|
+
if (toTop) {
|
|
129
|
+
toTop.style.visibility = "hidden";
|
|
130
|
+
toTop.addEventListener('click', () => {
|
|
131
|
+
msg.verbose('Scrolling to Top');
|
|
132
|
+
scrollTo(0, 0);
|
|
133
|
+
});
|
|
134
|
+
window.addEventListener('scroll', () => {
|
|
135
|
+
if (scrollY > 1500) {
|
|
136
|
+
msg.verbose('Scrolling to Top Button Visible');
|
|
137
|
+
toTop.style.visibility = "visible";
|
|
138
|
+
} else {
|
|
139
|
+
msg.verbose('Scrolling to Top Button Hidden');
|
|
140
|
+
toTop.style.visibility = "hidden";
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
142
144
|
|
|
143
145
|
});
|
|
144
146
|
|
package/src/modal.js
CHANGED
|
@@ -40,7 +40,7 @@ export const modal = {
|
|
|
40
40
|
loading.start(0, ajaxModalBody);
|
|
41
41
|
msg.verbose('Loading AJAX Modal');
|
|
42
42
|
fetch(el.getAttribute('modal-load-uri'), { method: 'GET' }).then(response => {
|
|
43
|
-
ajaxModalBody.insertAdjacentHTML('afterbegin', response);
|
|
43
|
+
ajaxModalBody.insertAdjacentHTML('afterbegin', response.text());
|
|
44
44
|
let images = ajaxModalBody.querySelectorAll('img')
|
|
45
45
|
if (images.length) {
|
|
46
46
|
let counter = images.length;
|