Skip to content

Commit

Permalink
fix(splitter): splitter jumps (narrow size), if the block has a min-w…
Browse files Browse the repository at this point in the history
…idth (#UIM-49)
  • Loading branch information
lskramarov authored Jul 15, 2019
1 parent 1f6b85f commit 99b97d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/mosaic/splitter/_splitter-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
background-color: mix(map-get($background, button-bg), map-get($background, hover));
}

&.mc-gutter_horizontal {
&.mc-gutter_vertical {
cursor: row-resize;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/mosaic/splitter/splitter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<ng-template ngFor let-area [ngForOf]="areas" let-index="index" let-last="last">
<mc-gutter *ngIf="last === false"
[class.mc-gutter_horizontal]="!isVertical"
[class.mc-gutter_vertical]="isVertical()"
[direction]="direction"
[attr.disabled]="disabled || null"
[size]="gutterSize"
Expand Down
10 changes: 5 additions & 5 deletions packages/mosaic/splitter/splitter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ export class McSplitterComponent implements OnInit {
}

private onMouseMove(event: MouseEvent, startPoint: IPoint, leftArea: IArea, rightArea: IArea) {
if (!this.isDragging || this.disabled) {
return;
}
if (!this.isDragging || this.disabled) { return; }

const endPoint: IPoint = {
x: event.screenX,
Expand Down Expand Up @@ -352,8 +350,10 @@ export class McSplitterAreaDirective implements OnInit, OnDestroy {
}

setSize(size: number): void {
const sz = coerceNumberProperty(size);
this.setStyle(this.getSizeProperty(), coerceCssPixelValue(sz));
if (size) {
const sz = coerceNumberProperty(size);
this.setStyle(this.getSizeProperty(), coerceCssPixelValue(sz));
}
}

getSize(): number {
Expand Down
2 changes: 1 addition & 1 deletion packages/mosaic/splitter/splitter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

overflow: hidden;

&.mc-gutter_horizontal > .mc-icon {
&.mc-gutter_vertical > .mc-icon {
transform: rotate(90deg);
}
}

0 comments on commit 99b97d9

Please sign in to comment.