mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Location] isLink/isOriginal are antonyms
Simplify implementation of isLink/isOriginal for better maintainability.
This commit is contained in:
parent
5c74365f4b
commit
26892e7104
@ -59,11 +59,10 @@ define(
|
||||
/**
|
||||
* Returns true if the domainObject is a link, false if it's an
|
||||
* original.
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
LocationCapability.prototype.isLink = function () {
|
||||
if (this.domainObject.getId() === "mine") {
|
||||
return false;
|
||||
}
|
||||
var model = this.domainObject.getModel();
|
||||
|
||||
return model.location !== this.getContextualLocation();
|
||||
@ -72,14 +71,11 @@ define(
|
||||
/**
|
||||
* Returns true if the domainObject is an original, false if it's a
|
||||
* link.
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
LocationCapability.prototype.isOriginal = function () {
|
||||
if (this.domainObject.getId() === "mine") {
|
||||
return true;
|
||||
}
|
||||
var model = this.domainObject.getModel();
|
||||
|
||||
return model.location === this.getContextualLocation();
|
||||
return !this.isLink();
|
||||
};
|
||||
|
||||
function createLocationCapability(domainObject) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user