Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 519aa51

Browse files
committed
Merge branch 'master' of github.com:BTMorton/angular2-grid
2 parents ba749df + 67b7e6f commit 519aa51

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular2-grid",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"homepage": "https://github.com/BTMorton/angular2-grid",
55
"authors": [
66
"Ben Morton <[email protected]> (http://bmorton.co.uk/)"

src/NgGrid.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,13 @@ export class NgGrid {
275275
}
276276

277277
public removeItem(ngItem: NgGridItem): void {
278+
this._removeFromGrid(ngItem);
278279
for (var x in this._items)
279280
if (this._items[x] == ngItem)
280-
this._items = this._items.splice(x, 1);
281+
this._items.splice(x, 1);
282+
283+
// Update position of all items
284+
this._items.forEach((item) => item.recalculateSelf());
281285
}
282286

283287
// Private methods
@@ -815,9 +819,8 @@ export class NgGrid {
815819
}
816820

817821
private _getMousePosition(e: any): {left: number, top: number} {
818-
if (e.originalEvent && e.originalEvent.touches) {
819-
var oe = e.originalEvent;
820-
e = oe.touches.length ? oe.touches[0] : oe.changedTouches[0];
822+
if (e instanceof TouchEvent) {
823+
e = e.touches.length > 0 ? e.touches[0] : e.changedTouches[0];
821824
}
822825

823826
var refPos = this._ngEl.nativeElement.getBoundingClientRect();

0 commit comments

Comments
 (0)