mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
- Mod PreviewAction to prevent folders from being previewed; Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
396817b2d1
commit
cfadb9f4fd
@ -63,7 +63,7 @@ export default class PreviewAction {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
appliesTo(objectPath) {
|
appliesTo(objectPath) {
|
||||||
return !this._isNavigatedObject(objectPath)
|
return !this._isNavigatedObject(objectPath) && !this._preventPreview(objectPath);
|
||||||
}
|
}
|
||||||
_isNavigatedObject(objectPath) {
|
_isNavigatedObject(objectPath) {
|
||||||
let targetObject = objectPath[0];
|
let targetObject = objectPath[0];
|
||||||
@ -71,4 +71,8 @@ export default class PreviewAction {
|
|||||||
return targetObject.identifier.namespace === navigatedObject.identifier.namespace &&
|
return targetObject.identifier.namespace === navigatedObject.identifier.namespace &&
|
||||||
targetObject.identifier.key === navigatedObject.identifier.key;
|
targetObject.identifier.key === navigatedObject.identifier.key;
|
||||||
}
|
}
|
||||||
|
_preventPreview(objectPath) {
|
||||||
|
const noPreviewTypes = ['folder'];
|
||||||
|
return noPreviewTypes.includes(objectPath[0].type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user