Use the subobject view type to determine where styles should be saved

This commit is contained in:
Joshi 2020-04-06 14:02:06 -07:00
parent 46a6a43234
commit 698508fde4

View File

@ -173,22 +173,21 @@ export default {
return styleProps; return styleProps;
}, },
getDomainObjectFromSelection() { getDomainObjectFromSelection() {
let layoutItem = {};
let domainObject; let domainObject;
if (this.selection[0].length > 1) { if (this.selection[0].length > 1) {
//If there are more than 1 items in the this.selection[0] list, the first one could either be a sub domain object OR a layout drawing control. //If there are more than 1 items in the this.selection[0] list, the first one could either be a sub domain object OR a layout drawing control.
//The second item in the this.selection[0] list is the container object (usually a layout) //The second item in the this.selection[0] list is the container object (usually a layout)
let layoutItem = this.selection[0][0].context.layoutItem;
const item = this.selection[0][0].context.item; const item = this.selection[0][0].context.item;
this.canHide = true; this.canHide = true;
if (item && item.composition) { if (layoutItem && (layoutItem.type === 'subobject-view')) {
domainObject = item; domainObject = item;
} else { } else {
domainObject = this.selection[0][1].context.item; domainObject = this.selection[0][1].context.item;
if (!item) { if (!item) {
//if this isn't a sub-object //if this isn't a sub-object
this.initialStyles = {}; this.initialStyles = {};
layoutItem = this.selection[0][0].context.layoutItem;
this.initialStyles = this.getStyleProperties(layoutItem); this.initialStyles = this.getStyleProperties(layoutItem);
this.itemId = layoutItem.id; this.itemId = layoutItem.id;
} else { } else {