Skip to content

Commit 963d30b

Browse files
author
Xie, Ziyu
authored
Merge pull request #117 from Yamazaki93/fix-size-locking
Added checking _direction when applying styles
2 parents 675c4d5 + ed0737a commit 963d30b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/angular2-draggable/src/lib/angular-resizable.directive.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,12 @@ export class AngularResizableDirective implements OnInit, OnChanges, OnDestroy,
405405

406406
private doResize() {
407407
const container = this.el.nativeElement;
408-
this.renderer.setStyle(container, 'height', this._currSize.height + 'px');
409-
this.renderer.setStyle(container, 'width', this._currSize.width + 'px');
408+
if (this._direction.n || this._direction.s || this._aspectRatio) {
409+
this.renderer.setStyle(container, 'height', this._currSize.height + 'px');
410+
}
411+
if (this._direction.w || this._direction.e || this._aspectRatio) {
412+
this.renderer.setStyle(container, 'width', this._currSize.width + 'px');
413+
}
410414
this.renderer.setStyle(container, 'left', this._currPos.x + 'px');
411415
this.renderer.setStyle(container, 'top', this._currPos.y + 'px');
412416
}

0 commit comments

Comments
 (0)