Created
May 12, 2020 13:08
-
-
Save bjoerntx/60782de9481d79e7a871ab1640ffa1e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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