Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dismiss the independent time conductor popup on unmount #6859

Merged
merged 11 commits into from
Aug 7, 2023
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/ConductorAxis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
this.openmct.time.on(TIME_CONTEXT_EVENTS.timeSystemChanged, this.setViewFromTimeSystem);
this.resizeTimer = setInterval(this.resize, RESIZE_POLL_INTERVAL);
},
beforeDestroy() {
beforeUnmount() {
clearInterval(this.resizeTimer);
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/ConductorHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default {
this.openmct.time.on(TIME_CONTEXT_EVENTS.timeSystemChanged, this.updateTimeSystem);
this.openmct.time.on(TIME_CONTEXT_EVENTS.modeChanged, this.updateMode);
},
beforeDestroy() {
beforeUnmount() {
this.openmct.time.off(TIME_CONTEXT_EVENTS.boundsChanged, this.addTimespan);
this.openmct.time.off(TIME_CONTEXT_EVENTS.clockOffsetsChanged, this.addTimespan);
this.openmct.time.off(TIME_CONTEXT_EVENTS.timeSystemChanged, this.updateTimeSystem);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/ConductorPopUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default {
this.$emit('popupLoaded');
this.setTimeContext();
},
beforeDestroy() {
beforeUnmount() {
this.stopFollowingTimeContext();
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/independent/IndependentClock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
}
}
},
beforeDestroy() {
beforeUnmount() {
this.openmct.time.off(TIME_CONTEXT_EVENTS.clockChanged, this.setViewFromClock);
},
mounted: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ export default {
conductorPopup: null
};
},
beforeUnmount() {
if (this.conductorPopup.parentNode === document.body) {
document.body.removeChild(this.conductorPopup);
this.conductorPopup = null;
}
},
mounted() {
this.positionBox = debounce(raf(this.positionBox), 250);
this.timeConductorOptionsHolder = this.$el;
this.timeConductorOptionsHolder.addEventListener('click', this.showPopup);
},
beforeDestroy() {
this.clearPopup();
},
methods: {
initializePopup() {
this.conductorPopup = this.$refs.conductorPopup.$el;
Expand All @@ -60,12 +63,7 @@ export default {
// itc toggled,
// something is emitting a dupe event with pointer id = -1, want to ignore those
// itc is currently enabled
if (
!this.conductorPopup &&
!isToggle &&
clickEvent.pointerId !== -1 &&
this.independentTCEnabled
) {
if (!isToggle && clickEvent.pointerId !== -1 && this.independentTCEnabled) {
this.showConductorPopup = true;
}
},
Expand Down Expand Up @@ -101,7 +99,6 @@ export default {
return;
}
this.showConductorPopup = false;
this.conductorPopup = null;
this.positionX = -10000; // reset it off screan

document.removeEventListener('click', this.handleClickAway);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/timePopupFixed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300);
this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.getTimeSystem())));
},
beforeDestroy() {
beforeUnmount() {
this.clearAllValidation();
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/timeConductor/timePopupRealtime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
this.setOffsets();
document.addEventListener('click', this.hide);
},
beforeDestroy() {
beforeUnmount() {
document.removeEventListener('click', this.hide);
},
methods: {
Expand Down