Skip to content

Commit 76c7dbb

Browse files
committed
feat(grid): some polish work #935
1 parent 257f4c6 commit 76c7dbb

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

projects/igniteui-angular/src/lib/grid/grid.common.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ export function autoWire(markForCheck = false) {
187187

188188
@Injectable()
189189
export class IgxColumnMovingService {
190-
private _column: IgxColumnComponent;
191190
private _icon: any;
191+
private _column: IgxColumnComponent;
192+
private _target: IgxColumnComponent;
192193

193194
get column(): IgxColumnComponent {
194195
return this._column;
@@ -199,6 +200,15 @@ export class IgxColumnMovingService {
199200
}
200201
}
201202

203+
get target(): IgxColumnComponent {
204+
return this._target;
205+
}
206+
set target(val: IgxColumnComponent) {
207+
if (val) {
208+
this._target = val;
209+
}
210+
}
211+
202212
get icon(): any {
203213
return this._icon;
204214
}
@@ -308,7 +318,8 @@ export class IgxColumnMovingDragDirective extends IgxDragDirective {
308318
const s = document.defaultView.getComputedStyle(this.element.nativeElement);
309319
this._dragGhost.style.width = Math.ceil(range.getBoundingClientRect().width +
310320
parseFloat(s.borderRightWidth) + parseFloat(s.borderLeftWidth) + parseFloat(s.paddingLeft) +
311-
parseFloat(s.paddingRight) + icon.getBoundingClientRect().width) + 'px';
321+
parseFloat(s.paddingRight) + icon.getBoundingClientRect().width) +
322+
parseFloat(document.defaultView.getComputedStyle(icon).marginRight) + 'px';
312323

313324
this.left = this._dragStartX = event.clientX -
314325
(((range.getBoundingClientRect().width + parseFloat(s.paddingLeft) + parseFloat(s.paddingRight)) / 3) * 2);

0 commit comments

Comments
 (0)