Object has no children fix (#2038)
* Added files for PR 1904 * Added new lines * space fix * Implemented changes * Space fix * checkstyle fix Fixes #1826
This commit is contained in:
committed by
Pete Richards
parent
b8f278cabf
commit
eaa9514453
@@ -27,9 +27,9 @@ define([
|
||||
'./TreeLabelView'
|
||||
], function ($, nodeTemplate, ToggleView, TreeLabelView) {
|
||||
|
||||
function TreeNodeView(gestureService, subtreeFactory, selectFn) {
|
||||
function TreeNodeView(gestureService, subtreeFactory, selectFn, openmct) {
|
||||
this.li = $('<li>');
|
||||
|
||||
this.openmct = openmct;
|
||||
this.statusClasses = [];
|
||||
|
||||
this.toggleView = new ToggleView(false);
|
||||
@@ -81,11 +81,14 @@ define([
|
||||
}
|
||||
|
||||
this.activeObject = domainObject;
|
||||
|
||||
if (domainObject && domainObject.hasCapability('composition')) {
|
||||
$(this.toggleView.elements()).removeClass('no-children');
|
||||
} else {
|
||||
$(this.toggleView.elements()).addClass('no-children');
|
||||
if (domainObject && domainObject.hasCapability('adapter')) {
|
||||
var obj = domainObject.useCapability('adapter');
|
||||
var hasComposition = this.openmct.composition.get(obj) !== undefined;
|
||||
if (hasComposition) {
|
||||
$(this.toggleView.elements()).removeClass('no-children');
|
||||
} else {
|
||||
$(this.toggleView.elements()).addClass('no-children');
|
||||
}
|
||||
}
|
||||
|
||||
if (domainObject && domainObject.hasCapability('status')) {
|
||||
@@ -150,6 +153,5 @@ define([
|
||||
return this.li;
|
||||
};
|
||||
|
||||
|
||||
return TreeNodeView;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user