@mjhls/mjh-framework 1.0.730-isiscroll-c → 1.0.730-isiscroll-d
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/cjs/View.js +9 -8
- package/dist/esm/View.js +9 -8
- package/package.json +1 -1
package/dist/cjs/View.js
CHANGED
|
@@ -228,15 +228,15 @@ var ISI = function ISI(props) {
|
|
|
228
228
|
}
|
|
229
229
|
}, [active]);
|
|
230
230
|
React.useEffect(function () {
|
|
231
|
-
|
|
232
231
|
var detectBottomOfArticle = function detectBottomOfArticle() {
|
|
233
232
|
var article_body = document.getElementById('article__block');
|
|
233
|
+
var isi = document.getElementById('isi');
|
|
234
234
|
var articleBottomPosition = article_body.getBoundingClientRect().bottom - window.innerHeight;
|
|
235
235
|
console.log(articleBottomPosition, bottomOfArticle);
|
|
236
|
-
if (articleBottomPosition <
|
|
236
|
+
if (articleBottomPosition < 30 && !isi.classList.contains('in-view')) {
|
|
237
237
|
setbottomOfArticle(true);
|
|
238
238
|
}
|
|
239
|
-
if (articleBottomPosition >
|
|
239
|
+
if (articleBottomPosition > 60 && isi.classList.contains('in-view')) {
|
|
240
240
|
setbottomOfArticle(false);
|
|
241
241
|
}
|
|
242
242
|
};
|
|
@@ -248,14 +248,14 @@ var ISI = function ISI(props) {
|
|
|
248
248
|
|
|
249
249
|
React.useEffect(function () {
|
|
250
250
|
var isi = document.getElementById('isi');
|
|
251
|
-
if (bottomOfArticle
|
|
251
|
+
if (bottomOfArticle) {
|
|
252
252
|
toggleSticky(true);
|
|
253
253
|
isi.classList.add('in-view');
|
|
254
254
|
if (active) {
|
|
255
255
|
setActive(false);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
if (bottomOfArticle
|
|
258
|
+
if (!bottomOfArticle) {
|
|
259
259
|
toggleSticky(false);
|
|
260
260
|
isi.classList.remove('in-view');
|
|
261
261
|
}
|
|
@@ -277,7 +277,8 @@ var ISI = function ISI(props) {
|
|
|
277
277
|
isiToggle.style.display = 'none';
|
|
278
278
|
isiContent.style.padding = '0';
|
|
279
279
|
}, 300);
|
|
280
|
-
}if (!sticky) {
|
|
280
|
+
} else if (!sticky) {
|
|
281
|
+
|
|
281
282
|
isi.style.marginBottom = '0';
|
|
282
283
|
isi.style.maxHeight = '10rem';
|
|
283
284
|
isi.style.position = 'fixed';
|
|
@@ -326,7 +327,7 @@ var ISI = function ISI(props) {
|
|
|
326
327
|
React__default['default'].createElement(
|
|
327
328
|
'style',
|
|
328
329
|
{ jsx: true },
|
|
329
|
-
'\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 10rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n
|
|
330
|
+
'\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 10rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n width: 100%;\n box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.5);\n transition: bottom .5s ease , margin-top .3s, max-height .2s;\n }\n #isiContent {\n width: 100%;\n max-width: 1000px;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n padding: 1rem;\n font-size: 1rem;\n }\n #isi::-webkit-scrollbar {\n display: none;\n }\n #isiToggle {\n position: absolute;\n top: 0;\n right: 0;\n padding: 1rem;\n font-weight: bold;\n cursor: pointer;\n font-size: 1rem;\n }\n #isiToggle p {\n margin: 0;\n }\n '
|
|
330
331
|
)
|
|
331
332
|
);
|
|
332
333
|
};
|
|
@@ -1105,7 +1106,7 @@ var Article = function Article(props) {
|
|
|
1105
1106
|
)
|
|
1106
1107
|
)
|
|
1107
1108
|
),
|
|
1108
|
-
React__default['default'].createElement('hr', { className: 'article-seperater mb-5 mt-3' })
|
|
1109
|
+
props.infiniteScroll && React__default['default'].createElement('hr', { className: 'article-seperater mb-5 mt-3' })
|
|
1109
1110
|
);
|
|
1110
1111
|
};
|
|
1111
1112
|
|
package/dist/esm/View.js
CHANGED
|
@@ -218,15 +218,15 @@ var ISI = function ISI(props) {
|
|
|
218
218
|
}
|
|
219
219
|
}, [active]);
|
|
220
220
|
useEffect(function () {
|
|
221
|
-
|
|
222
221
|
var detectBottomOfArticle = function detectBottomOfArticle() {
|
|
223
222
|
var article_body = document.getElementById('article__block');
|
|
223
|
+
var isi = document.getElementById('isi');
|
|
224
224
|
var articleBottomPosition = article_body.getBoundingClientRect().bottom - window.innerHeight;
|
|
225
225
|
console.log(articleBottomPosition, bottomOfArticle);
|
|
226
|
-
if (articleBottomPosition <
|
|
226
|
+
if (articleBottomPosition < 30 && !isi.classList.contains('in-view')) {
|
|
227
227
|
setbottomOfArticle(true);
|
|
228
228
|
}
|
|
229
|
-
if (articleBottomPosition >
|
|
229
|
+
if (articleBottomPosition > 60 && isi.classList.contains('in-view')) {
|
|
230
230
|
setbottomOfArticle(false);
|
|
231
231
|
}
|
|
232
232
|
};
|
|
@@ -238,14 +238,14 @@ var ISI = function ISI(props) {
|
|
|
238
238
|
|
|
239
239
|
useEffect(function () {
|
|
240
240
|
var isi = document.getElementById('isi');
|
|
241
|
-
if (bottomOfArticle
|
|
241
|
+
if (bottomOfArticle) {
|
|
242
242
|
toggleSticky(true);
|
|
243
243
|
isi.classList.add('in-view');
|
|
244
244
|
if (active) {
|
|
245
245
|
setActive(false);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
if (bottomOfArticle
|
|
248
|
+
if (!bottomOfArticle) {
|
|
249
249
|
toggleSticky(false);
|
|
250
250
|
isi.classList.remove('in-view');
|
|
251
251
|
}
|
|
@@ -267,7 +267,8 @@ var ISI = function ISI(props) {
|
|
|
267
267
|
isiToggle.style.display = 'none';
|
|
268
268
|
isiContent.style.padding = '0';
|
|
269
269
|
}, 300);
|
|
270
|
-
}if (!sticky) {
|
|
270
|
+
} else if (!sticky) {
|
|
271
|
+
|
|
271
272
|
isi.style.marginBottom = '0';
|
|
272
273
|
isi.style.maxHeight = '10rem';
|
|
273
274
|
isi.style.position = 'fixed';
|
|
@@ -316,7 +317,7 @@ var ISI = function ISI(props) {
|
|
|
316
317
|
React.createElement(
|
|
317
318
|
'style',
|
|
318
319
|
{ jsx: true },
|
|
319
|
-
'\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 10rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n
|
|
320
|
+
'\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 10rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n width: 100%;\n box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.5);\n transition: bottom .5s ease , margin-top .3s, max-height .2s;\n }\n #isiContent {\n width: 100%;\n max-width: 1000px;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n padding: 1rem;\n font-size: 1rem;\n }\n #isi::-webkit-scrollbar {\n display: none;\n }\n #isiToggle {\n position: absolute;\n top: 0;\n right: 0;\n padding: 1rem;\n font-weight: bold;\n cursor: pointer;\n font-size: 1rem;\n }\n #isiToggle p {\n margin: 0;\n }\n '
|
|
320
321
|
)
|
|
321
322
|
);
|
|
322
323
|
};
|
|
@@ -1095,7 +1096,7 @@ var Article = function Article(props) {
|
|
|
1095
1096
|
)
|
|
1096
1097
|
)
|
|
1097
1098
|
),
|
|
1098
|
-
React.createElement('hr', { className: 'article-seperater mb-5 mt-3' })
|
|
1099
|
+
props.infiniteScroll && React.createElement('hr', { className: 'article-seperater mb-5 mt-3' })
|
|
1099
1100
|
);
|
|
1100
1101
|
};
|
|
1101
1102
|
|