From 781443a4cc9bf0bef30b57e3d780ca1eaefccc8a Mon Sep 17 00:00:00 2001 From: Hannes Widmoser Date: Thu, 19 May 2016 12:14:37 +0200 Subject: [PATCH] Fix placeholder update --- dist/tileview.js | 12 ++++-------- package.json | 2 +- src/tileview.ts | 12 ++++-------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/dist/tileview.js b/dist/tileview.js index ea7caec..f32c755 100644 --- a/dist/tileview.js +++ b/dist/tileview.js @@ -169,14 +169,10 @@ } } function setPlaceholder() { - var newHeightStart = Math.max(startRow * scope.options.tileSize[sizeDimension], 0); - var newHeightEnd = Math.max((rowCount - endRow) * scope.options.tileSize[sizeDimension], 0); - if (newHeightStart !== heightStart || newHeightEnd !== heightEnd) { - placeholderStart.css(sizeDimension, newHeightStart + 'px'); - placeholderEnd.css(sizeDimension, newHeightEnd + 'px'); - heightStart = newHeightStart; - heightEnd = newHeightEnd; - } + heightStart = Math.max(startRow * scope.options.tileSize[sizeDimension], 0); + heightEnd = Math.max((rowCount - endRow) * scope.options.tileSize[sizeDimension], 0); + placeholderStart.css(sizeDimension, heightStart + 'px'); + placeholderEnd.css(sizeDimension, heightEnd + 'px'); } function createElements(diff) { updateVisibleRows(); diff --git a/package.json b/package.json index c218154..61e5546 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-tileview", - "version": "0.5.7", + "version": "0.5.8", "description": "A tileview for angular", "main": "gulpfile.js", "scripts": { diff --git a/src/tileview.ts b/src/tileview.ts index 296ee2b..b29d496 100644 --- a/src/tileview.ts +++ b/src/tileview.ts @@ -191,14 +191,10 @@ declare const angular: any; } function setPlaceholder() { - const newHeightStart = Math.max(startRow * scope.options.tileSize[sizeDimension], 0); - const newHeightEnd = Math.max((rowCount - endRow) * scope.options.tileSize[sizeDimension], 0); - if (newHeightStart !== heightStart || newHeightEnd !== heightEnd) { - placeholderStart.css(sizeDimension, newHeightStart + 'px'); - placeholderEnd.css(sizeDimension, newHeightEnd + 'px'); - heightStart = newHeightStart; - heightEnd = newHeightEnd; - } + heightStart = Math.max(startRow * scope.options.tileSize[sizeDimension], 0); + heightEnd = Math.max((rowCount - endRow) * scope.options.tileSize[sizeDimension], 0); + placeholderStart.css(sizeDimension, heightStart + 'px'); + placeholderEnd.css(sizeDimension, heightEnd + 'px'); } function createElements(diff) {