This repository was archived by the owner on Mar 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 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/)"
Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments