mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
kinda weird but dragging content to the bottom can break browser functionality so this is a bodge
This commit is contained in:
parent
f135f79d13
commit
1f4d11a960
1 changed files with 15 additions and 1 deletions
|
@ -1585,7 +1585,21 @@ function Ace2Inner(){
|
|||
b = range[1];
|
||||
var firstDirtyNode = (((a === 0) && root.firstChild) || getCleanNodeByKey(rep.lines.atIndex(a - 1).key).nextSibling);
|
||||
firstDirtyNode = (firstDirtyNode && isNodeDirty(firstDirtyNode) && firstDirtyNode);
|
||||
var lastDirtyNode = (((b == rep.lines.length()) && root.lastChild) || getCleanNodeByKey(rep.lines.atIndex(b).key).previousSibling);
|
||||
// top.console.log("b", b);
|
||||
// top.console.log("foo", rep.lines.atIndex(b));
|
||||
// top.console.log("mheh", getCleanNodeByKey(rep.lines.atIndex(b)));
|
||||
try{
|
||||
var isSane = getCleanNodeByKey(rep.lines.atIndex(b).key);
|
||||
}catch(e){
|
||||
top.console.error("Line key "+b+" doesn't exist in DOM, Dragging to the bottom line is currently broken");
|
||||
top.location.reload();
|
||||
}
|
||||
// top.console.log("sane?", isSane);
|
||||
if(isSane){
|
||||
var lastDirtyNode = (((b == rep.lines.length()) && root.lastChild) || getCleanNodeByKey(rep.lines.atIndex(b).key).previousSibling);
|
||||
}else{
|
||||
var lastDirtyNode = ((b == rep.lines.length()) && root.lastChild);
|
||||
}
|
||||
lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode);
|
||||
if (firstDirtyNode && lastDirtyNode)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue