mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
ace2_inner: Readability improvements
This commit is contained in:
parent
bc6428025a
commit
88057eade2
1 changed files with 4 additions and 17 deletions
|
@ -1125,19 +1125,9 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
|
||||
const domChanges = (splicesToDo.length > 0);
|
||||
|
||||
// update the representation
|
||||
for (const splice of splicesToDo) {
|
||||
doIncorpLineSplice(splice[0], splice[1], splice[2], splice[3], splice[4]);
|
||||
}
|
||||
|
||||
// do DOM inserts
|
||||
for (const ins of domInsertsNeeded) insertDomLines(ins[0], ins[1]);
|
||||
|
||||
// delete old dom nodes
|
||||
for (const n of toDeleteAtEnd) {
|
||||
// parent of n may not be "root" in IE due to non-tree-shaped DOM (wtf)
|
||||
if (n.parentNode) n.parentNode.removeChild(n);
|
||||
}
|
||||
for (const splice of splicesToDo) doIncorpLineSplice(...splice);
|
||||
for (const ins of domInsertsNeeded) insertDomLines(...ins);
|
||||
for (const n of toDeleteAtEnd) n.remove();
|
||||
|
||||
// needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
||||
if (scrollToTheLeftNeeded) {
|
||||
|
@ -2269,10 +2259,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
|
||||
const markNodeClean = (n) => {
|
||||
// clean nodes have knownHTML that matches their innerHTML
|
||||
const dirtiness = {};
|
||||
dirtiness.nodeId = uniqueId(n);
|
||||
dirtiness.knownHTML = n.innerHTML;
|
||||
setAssoc(n, 'dirtiness', dirtiness);
|
||||
setAssoc(n, 'dirtiness', {nodeId: uniqueId(n), knownHTML: n.innerHTML});
|
||||
};
|
||||
|
||||
const isNodeDirty = (n) => {
|
||||
|
|
Loading…
Reference in a new issue