Update editEntities.js lock checking to use event instead of polling

This commit is contained in:
Ryan Huffman 2015-03-02 10:42:09 -08:00
parent a443157dd7
commit 26e3b331ee

View file

@ -406,13 +406,11 @@ var toolBar = (function () {
that.setActive(false); that.setActive(false);
}); });
function checkForPermissionToEdit() { Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) {
if (isActive && !Entities.canAdjustLocks()) { if (isActive && !canAdjustLocks) {
that.setActive(false); that.setActive(false);
} }
} });
Script.setInterval(checkForPermissionToEdit, 1000);
that.cleanup = function () { that.cleanup = function () {
toolBar.cleanup(); toolBar.cleanup();