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);
|
const domChanges = (splicesToDo.length > 0);
|
||||||
|
|
||||||
// update the representation
|
for (const splice of splicesToDo) doIncorpLineSplice(...splice);
|
||||||
for (const splice of splicesToDo) {
|
for (const ins of domInsertsNeeded) insertDomLines(...ins);
|
||||||
doIncorpLineSplice(splice[0], splice[1], splice[2], splice[3], splice[4]);
|
for (const n of toDeleteAtEnd) n.remove();
|
||||||
}
|
|
||||||
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
// needed to stop chrome from breaking the ui when long strings without spaces are pasted
|
||||||
if (scrollToTheLeftNeeded) {
|
if (scrollToTheLeftNeeded) {
|
||||||
|
@ -2269,10 +2259,7 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
|
|
||||||
const markNodeClean = (n) => {
|
const markNodeClean = (n) => {
|
||||||
// clean nodes have knownHTML that matches their innerHTML
|
// clean nodes have knownHTML that matches their innerHTML
|
||||||
const dirtiness = {};
|
setAssoc(n, 'dirtiness', {nodeId: uniqueId(n), knownHTML: n.innerHTML});
|
||||||
dirtiness.nodeId = uniqueId(n);
|
|
||||||
dirtiness.knownHTML = n.innerHTML;
|
|
||||||
setAssoc(n, 'dirtiness', dirtiness);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const isNodeDirty = (n) => {
|
const isNodeDirty = (n) => {
|
||||||
|
|
Loading…
Reference in a new issue