mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 21:28:12 +00:00
Fix the browser back button in Open MCT (#3526)
Fixes Open MCT back button. Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
@ -228,15 +228,16 @@ export default {
|
||||
|
||||
doTickUpdate() {
|
||||
if (this.shouldCheckWidth) {
|
||||
const tickElements = this.$refs.tickContainer.querySelectorAll('.gl-plot-tick > span');
|
||||
const tickElements = this.$refs.tickContainer && this.$refs.tickContainer.querySelectorAll('.gl-plot-tick > span');
|
||||
if (tickElements) {
|
||||
const tickWidth = Number([].reduce.call(tickElements, function (memo, first) {
|
||||
return Math.max(memo, first.offsetWidth);
|
||||
}, 0));
|
||||
|
||||
const tickWidth = Number([].reduce.call(tickElements, function (memo, first) {
|
||||
return Math.max(memo, first.offsetWidth);
|
||||
}, 0));
|
||||
|
||||
this.tickWidth = tickWidth;
|
||||
this.$emit('plotTickWidth', tickWidth);
|
||||
this.shouldCheckWidth = false;
|
||||
this.tickWidth = tickWidth;
|
||||
this.$emit('plotTickWidth', tickWidth);
|
||||
this.shouldCheckWidth = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.tickUpdate = false;
|
||||
|
@ -118,6 +118,11 @@ describe("the plugin", function () {
|
||||
});
|
||||
|
||||
afterEach((done) => {
|
||||
openmct.time.timeSystem('utc', {
|
||||
start: 0,
|
||||
end: 1
|
||||
});
|
||||
|
||||
// Needs to be in a timeout because plots use a bunch of setTimeouts, some of which can resolve during or after
|
||||
// teardown, which causes problems
|
||||
// This is hacky, we should find a better approach here.
|
||||
@ -129,7 +134,7 @@ describe("the plugin", function () {
|
||||
|
||||
configStore.deleteAll();
|
||||
|
||||
resetApplicationState(openmct).then(done);
|
||||
resetApplicationState(openmct).then(done).catch(done);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user