From 4c549c6cdd18ded013fa51a725a82db8c63ca84d Mon Sep 17 00:00:00 2001 From: Nicola Carminati Date: Thu, 31 May 2018 07:58:24 +0200 Subject: [PATCH] Fix center-screen when select a magpos --- Step/wwwroot/src/components/depot.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Step/wwwroot/src/components/depot.ts b/Step/wwwroot/src/components/depot.ts index 21450308..929a86bc 100644 --- a/Step/wwwroot/src/components/depot.ts +++ b/Step/wwwroot/src/components/depot.ts @@ -136,9 +136,9 @@ export default class depot extends Vue { this.currentPosition = index; var c = (this.$refs.positionslist as any); - var move = index * this.BLOCKSIZE; - if (index < this.positions.length - 2) - move = move - 2 * this.BLOCKSIZE; - c.scrollLeft = move; + var move = (index * this.BLOCKSIZE) ; + c.scrollLeft = move - (c.clientWidth /2) + this.BLOCKSIZE/2; + + } }