Merge pull request #5860 from ctrlaltdavid/20686

QA for 20686 - Clear entity list when you change domains
This commit is contained in:
Brad Hefta-Gaub 2015-09-21 12:01:43 -07:00
commit 25f506f3dc
3 changed files with 16 additions and 2 deletions

View file

@ -245,6 +245,10 @@ var toolBar = (function () {
that.setActive(false);
}
that.clearEntityList = function() {
entityListTool.clearEntityList();
};
that.setActive = function(active) {
if (active != isActive) {
if (active && !Entities.canAdjustLocks()) {
@ -510,6 +514,7 @@ var toolBar = (function () {
Window.domainChanged.connect(function() {
that.setActive(false);
that.clearEntityList();
});
Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) {

View file

@ -201,7 +201,9 @@
EventBridge.scriptEventReceived.connect(function(data) {
data = JSON.parse(data);
if (data.type == "selectionUpdate") {
if (data.type === "clearEntityList") {
clearEntities();
} else if (data.type == "selectionUpdate") {
var notFound = updateSelectedEntities(data.selectedIDs);
if (notFound) {
refreshEntities();

View file

@ -26,13 +26,20 @@ EntityListTool = function(opts) {
selectedIDs.push(selectionManager.selections[i]);
}
data = {
var data = {
type: 'selectionUpdate',
selectedIDs: selectedIDs,
};
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
});
that.clearEntityList = function () {
var data = {
type: 'clearEntityList'
}
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
};
that.sendUpdate = function() {
var entities = [];
var ids = Entities.findEntities(MyAvatar.position, searchRadius);