have edit.js resend properties of selected entity to entityProperties.js once it's ready

This commit is contained in:
Seth Alves 2017-03-10 09:59:23 -08:00
parent 8490379517
commit d792559d9a
2 changed files with 9 additions and 2 deletions

View file

@ -1548,7 +1548,7 @@ var PropertiesTool = function (opts) {
});
}
selectionManager.addEventListener(function (selectionUpdated) {
function updateSelections(selectionUpdated) {
var data = {
type: 'update'
};
@ -1589,7 +1589,8 @@ var PropertiesTool = function (opts) {
}
data.selections = selections;
webView.emitScriptEvent(JSON.stringify(data));
});
}
selectionManager.addEventListener(updateSelections);
webView.webEventReceived.connect(function (data) {
try {
@ -1751,6 +1752,8 @@ var PropertiesTool = function (opts) {
}
}
}
} else if (data.type === "propertiesPageReady") {
updateSelections(true);
}
});

View file

@ -1704,4 +1704,8 @@ function loaded() {
document.addEventListener("contextmenu", function(event) {
event.preventDefault();
}, false);
setTimeout(function() {
EventBridge.emitWebEvent(JSON.stringify({ type: 'propertiesPageReady' }));
}, 1000);
}