[Layout] Deselect object after removal

If the selected object is not in the composition, deselect it.

Add tests.

Fixes #1731
This commit is contained in:
Pegah Sarram
2017-10-02 13:49:12 -07:00
parent 9570f2f7a1
commit 00dc2875bf
2 changed files with 21 additions and 2 deletions

View File

@@ -26,8 +26,12 @@
* @namespace platform/features/layout
*/
define(
['./LayoutDrag'],
function (LayoutDrag) {
[
'./LayoutDrag'
],
function (
LayoutDrag
) {
var DEFAULT_DIMENSIONS = [12, 8],
DEFAULT_GRID_SIZE = [32, 32],
@@ -124,6 +128,10 @@ define(
self.select(null, self.droppedIdToSelectAfterRefresh);
delete self.droppedIdToSelectAfterRefresh;
}
if (composition.indexOf(self.selectedId) === -1) {
self.clearSelection();
}
}
});
}