mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
oof, dat bugz
This commit is contained in:
parent
d930a12e37
commit
66d3d6a02d
2 changed files with 70 additions and 14 deletions
|
@ -328,6 +328,17 @@ Scroll.prototype.getVisibleLineRange = function (rep) {
|
|||
return [start, end - 1];
|
||||
};
|
||||
|
||||
Scroll.prototype.getPartiallyVisibleLineRange = function (rep) {
|
||||
const viewport = this._getViewPortTopBottom();
|
||||
const obj = {};
|
||||
const self = this;
|
||||
const start = rep.lines.search((e) => self._getLineEntryTopBottom(e, obj).top > viewport.top);
|
||||
let end = rep.lines.search((e) => self._getLineEntryTopBottom(e, obj).top >= viewport.bottom);
|
||||
if (end < start) end = start; // unlikely
|
||||
return [start, end - 1];
|
||||
};
|
||||
|
||||
|
||||
Scroll.prototype.getVisibleCharRange = function (rep) {
|
||||
const lineRange = this.getVisibleLineRange(rep);
|
||||
// top.console.log('char range', 0, rep.lines.offsetOfIndex(lineRange[0]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue