mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 06:31:04 +00:00
[Time Controller] Show only outermost controller
WTD-1515
This commit is contained in:
parent
f74da6b935
commit
b668fb58fb
@ -34,7 +34,8 @@ define(
|
|||||||
'height: ' + CONDUCTOR_HEIGHT + '">',
|
'height: ' + CONDUCTOR_HEIGHT + '">',
|
||||||
"<mct-include key=\"'time-controller'\"></mct-include>",
|
"<mct-include key=\"'time-controller'\"></mct-include>",
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('');
|
].join(''),
|
||||||
|
GLOBAL_SHOWING = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ConductorRepresenter attaches the universal time conductor
|
* The ConductorRepresenter attaches the universal time conductor
|
||||||
@ -64,11 +65,9 @@ define(
|
|||||||
|
|
||||||
// Handle a specific representation of a specific domain object
|
// Handle a specific representation of a specific domain object
|
||||||
ConductorRepresenter.prototype.represent = function represent(representation, representedObject) {
|
ConductorRepresenter.prototype.represent = function represent(representation, representedObject) {
|
||||||
if (this.showing) {
|
this.destroy();
|
||||||
this.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.views.indexOf(representation) !== -1) {
|
if (this.views.indexOf(representation) !== -1 && !GLOBAL_SHOWING) {
|
||||||
// Create a new scope for the conductor
|
// Create a new scope for the conductor
|
||||||
this.conductorScope(this.getScope().$new());
|
this.conductorScope(this.getScope().$new());
|
||||||
this.conductorElement =
|
this.conductorElement =
|
||||||
@ -77,11 +76,18 @@ define(
|
|||||||
this.element.addClass('abs');
|
this.element.addClass('abs');
|
||||||
this.element.css('bottom', CONDUCTOR_HEIGHT);
|
this.element.css('bottom', CONDUCTOR_HEIGHT);
|
||||||
this.showing = true;
|
this.showing = true;
|
||||||
|
GLOBAL_SHOWING = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Respond to the destruction of the current representation.
|
// Respond to the destruction of the current representation.
|
||||||
ConductorRepresenter.prototype.destroy = function destroy() {
|
ConductorRepresenter.prototype.destroy = function destroy() {
|
||||||
|
// We may not have decided to show in the first place,
|
||||||
|
// so circumvent any unnecessary cleanup
|
||||||
|
if (!this.showing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the original size of the mct-representation
|
// Restore the original size of the mct-representation
|
||||||
if (!this.hadAbs) {
|
if (!this.hadAbs) {
|
||||||
this.element.removeClass('abs');
|
this.element.removeClass('abs');
|
||||||
@ -101,6 +107,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.showing = false;
|
this.showing = false;
|
||||||
|
GLOBAL_SHOWING = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
return ConductorRepresenter;
|
return ConductorRepresenter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user