Commit 6ff8146d authored by Jose Vargas's avatar Jose Vargas

Change forceRedraw key format

parent efedd968
...@@ -98,12 +98,12 @@ export default { ...@@ -98,12 +98,12 @@ export default {
state: 'gettingStarted', state: 'gettingStarted',
showEmptyState: true, showEmptyState: true,
hoverData: {}, hoverData: {},
updateDashboardKeyNumber: 0, elWidth: 0,
}; };
}, },
computed: { computed: {
forceRedraw() { forceRedraw() {
return `dashboard-key-${this.updateDashboardKeyNumber}`; return this.elWidth;
}, },
}, },
created() { created() {
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
}); });
}, },
resize() { resize() {
this.updateDashboardKeyNumber += 1; this.elWidth = this.$el.clientWidth;
}, },
hoverChanged(data) { hoverChanged(data) {
this.hoverData = data; this.hoverData = data;
......
...@@ -150,7 +150,7 @@ describe('Dashboard', () => { ...@@ -150,7 +150,7 @@ describe('Dashboard', () => {
propsData: { ...propsData, hasMetrics: true, showPanels: false }, propsData: { ...propsData, hasMetrics: true, showPanels: false },
}); });
expect(component.forceRedraw).toEqual('dashboard-key-0'); expect(component.forceRedraw).toEqual(0);
const navSidebarEl = document.querySelector('.nav-sidebar'); const navSidebarEl = document.querySelector('.nav-sidebar');
navSidebarEl.classList.add('nav-sidebar-collapsed'); navSidebarEl.classList.add('nav-sidebar-collapsed');
...@@ -161,7 +161,7 @@ describe('Dashboard', () => { ...@@ -161,7 +161,7 @@ describe('Dashboard', () => {
return Vue.nextTick(); return Vue.nextTick();
}) })
.then(() => { .then(() => {
expect(component.forceRedraw).toEqual('dashboard-key-1'); expect(component.forceRedraw).toEqual(component.elWidth);
done(); done();
}) })
.catch(done.fail); .catch(done.fail);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment