Skip to content

Commit

Permalink
Fix placeholder update
Browse files Browse the repository at this point in the history
  • Loading branch information
widmoser committed May 19, 2016
1 parent b8ebaba commit 781443a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
12 changes: 4 additions & 8 deletions dist/tileview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-tileview",
"version": "0.5.7",
"version": "0.5.8",
"description": "A tileview for angular",
"main": "gulpfile.js",
"scripts": {
Expand Down
12 changes: 4 additions & 8 deletions src/tileview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 781443a

Please sign in to comment.