mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[Selection] At Path.toArray
This commit is contained in:
parent
6e664003e3
commit
cc9efdff31
@ -48,6 +48,10 @@ define([], function () {
|
||||
return new Path(item, this);
|
||||
};
|
||||
|
||||
Path.prototype.toArray = function () {
|
||||
return [this.item].concat(this.parent.toArray());
|
||||
};
|
||||
|
||||
NULL_PATH = new Path(undefined, undefined);
|
||||
NULL_PATH.parent = NULL_PATH;
|
||||
NULL_PATH.depth = function () {
|
||||
@ -56,6 +60,9 @@ define([], function () {
|
||||
NULL_PATH.matches = function (path) {
|
||||
return path.depth() === 0;
|
||||
};
|
||||
NULL_PATH.toArray = function () {
|
||||
return [];
|
||||
};
|
||||
|
||||
return Path;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user