md-editor-v3 4.16.4 → 4.16.5
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/lib/cjs/MdEditor.cjs +3 -3
- package/lib/es/MdEditor.mjs +3 -3
- package/lib/umd/index.js +5 -5
- package/package.json +1 -1
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -1353,7 +1353,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1353
1353
|
const curr = elesHasLineNumber[i];
|
|
1354
1354
|
const sibling = elesHasLineNumber[i].previousElementSibling;
|
|
1355
1355
|
if (curr.offsetTop + curr.offsetHeight > cMaxScrollLength && sibling.offsetTop < cMaxScrollLength) {
|
|
1356
|
-
lineNumer = Number(
|
|
1356
|
+
lineNumer = Number(sibling.dataset.line);
|
|
1357
1357
|
break;
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
@@ -1440,8 +1440,8 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1440
1440
|
);
|
|
1441
1441
|
let blockHeight = 0;
|
|
1442
1442
|
if (endLineScrollTop > scrollDOM.scrollHeight - scrollDOM.clientHeight || realEleEnd.offsetTop + realEleEnd.offsetHeight > cEle.scrollHeight - cEle.clientHeight) {
|
|
1443
|
-
scale = (cScrollTop
|
|
1444
|
-
blockHeight =
|
|
1443
|
+
scale = (cScrollTop - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop - cEle.clientHeight);
|
|
1444
|
+
blockHeight = scrollDOM.scrollHeight - firstLineScrollTop - scrollDOM.clientHeight;
|
|
1445
1445
|
} else if (realEleStart === ((_f = cEle.firstElementChild) == null ? void 0 : _f.firstElementChild)) {
|
|
1446
1446
|
if (realEleStart === realEleEnd) {
|
|
1447
1447
|
eleEndOffsetTop = realEleEnd.offsetTop + realEleEnd.offsetHeight + +getComputedStyle(realEleEnd).marginBottom.replace("px", "");
|
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -1352,7 +1352,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1352
1352
|
const curr = elesHasLineNumber[i];
|
|
1353
1353
|
const sibling = elesHasLineNumber[i].previousElementSibling;
|
|
1354
1354
|
if (curr.offsetTop + curr.offsetHeight > cMaxScrollLength && sibling.offsetTop < cMaxScrollLength) {
|
|
1355
|
-
lineNumer = Number(
|
|
1355
|
+
lineNumer = Number(sibling.dataset.line);
|
|
1356
1356
|
break;
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
@@ -1439,8 +1439,8 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
|
|
|
1439
1439
|
);
|
|
1440
1440
|
let blockHeight = 0;
|
|
1441
1441
|
if (endLineScrollTop > scrollDOM.scrollHeight - scrollDOM.clientHeight || realEleEnd.offsetTop + realEleEnd.offsetHeight > cEle.scrollHeight - cEle.clientHeight) {
|
|
1442
|
-
scale = (cScrollTop
|
|
1443
|
-
blockHeight =
|
|
1442
|
+
scale = (cScrollTop - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop - cEle.clientHeight);
|
|
1443
|
+
blockHeight = scrollDOM.scrollHeight - firstLineScrollTop - scrollDOM.clientHeight;
|
|
1444
1444
|
} else if (realEleStart === ((_f = cEle.firstElementChild) == null ? void 0 : _f.firstElementChild)) {
|
|
1445
1445
|
if (realEleStart === realEleEnd) {
|
|
1446
1446
|
eleEndOffsetTop = realEleEnd.offsetTop + realEleEnd.offsetHeight + +getComputedStyle(realEleEnd).marginBottom.replace("px", "");
|