Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 12, 2020 13:08
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/60782de9481d79e7a871ab1640ffa1e4 to your computer and use it in GitHub Desktop.
Save bjoerntx/60782de9481d79e7a871ab1640ffa1e4 to your computer and use it in GitHub Desktop.
function updateSection(region) {
// check flags
if (_updating === true || _dirtyFlag === false)
return;
TXTextControl.editableRegions.forEach(function (er) {
// find region by id
er.getID(function (id) {
if (region.editableRegion.id == id) {
// save the region content
er.save(TXTextControl.StreamType.InternalUnicodeFormat,
function (doc) {
// create sync object
var regionSyncObject = {
User: region.editableRegion.userName,
RegionId: id, Document: doc.data
};
// call signalr hub with sync object
_connection.invoke("SetEditableRegionSync",
regionSyncObject).catch(function (err) {
return console.error(err.toString());
});
});
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment