Skip to content

Commit

Permalink
feat: improve split further
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Nov 2, 2018
1 parent 5f0126c commit 0ee9339
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/ui/split/split.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="handle bg-primary"
(dblclick)="toggle()"
(mousedown)="onMouseDown($event)">
<button mat-fab=""
#buttonEl
Expand Down
4 changes: 4 additions & 0 deletions src/app/ui/split/split.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
width: 100%;
cursor: row-resize;

&:hover {
//transform: translateY(-$s);
}

.handle {
position: absolute;
width: 100%;
Expand Down
8 changes: 8 additions & 0 deletions src/app/ui/split/split.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export class SplitComponent implements OnInit {
console.log(this.buttonEl);
}

toggle() {
let newPos = 50;
if (this.pos === 50) {
newPos = 100;
}
this._updatePos(newPos);
}

onMouseDown(ev) {
console.log('onMouseDown', ev);
const mouseup$ = fromEvent(document, 'mouseup');
Expand Down

0 comments on commit 0ee9339

Please sign in to comment.