Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created February 18, 2021 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/bab54502be1ce21123c2ffd6449a58b0 to your computer and use it in GitHub Desktop.
Save bjoerntx/bab54502be1ce21123c2ffd6449a58b0 to your computer and use it in GitHub Desktop.
function removeAllChanges(accept) {
TXTextControl.trackedChanges.getCount(count => {
if (count === 0) return;
// recursively loop through all changes
// and remove them
TXTextControl.trackedChanges.elementAt(0, element => {
TXTextControl.trackedChanges.remove(element, accept, deleted => {
if (deleted === true) removeAllChanges(accept);
});
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment