Implementation of the space

This commit is contained in:
NejcZdovc
2016-11-29 06:22:47 +01:00
committed by József Farkas
parent 96e80ad7ef
commit 31b3aae64b
6 changed files with 26 additions and 6 deletions

View File

@@ -1,5 +1,9 @@
@import '../../../main-app/global-styles';
:host {
display: block;
}
.keymap {
&__is-default {

View File

@@ -26,6 +26,10 @@
}
}
.nav-tabs > li {
overflow: hidden;
}
.arrowCustom {
position: absolute;
top: -16px;

View File

@@ -53,9 +53,12 @@ enum TabName {
]))
]),
transition('closed => opened', [
style({
visibility: 'visible'
}),
animate('200ms ease-out', keyframes([
style({ transform: 'translateY(30px)', visibility: 'visible', opacity: 0, offset: 0 }),
style({ transform: 'translateY(0)', visibility: 'visible', opacity: 1, offset: 1 })
style({ transform: 'translateY(30px)', opacity: 0, offset: 0 }),
style({ transform: 'translateY(0)', opacity: 1, offset: 1 })
]))
])
])
@@ -148,7 +151,7 @@ export class PopoverComponent implements OnChanges {
}
private calculatePosition() {
const offsetLeft: number = this.wrapPosition.left + 265;
const offsetLeft: number = this.wrapPosition.left + 265; // 265 is a width of the side menu with a margin
const popover: HTMLElement = this.popoverHost.nativeElement;
let newLeft: number = this.keyPosition.left + (this.keyPosition.width / 2);
@@ -163,7 +166,8 @@ export class PopoverComponent implements OnChanges {
newLeft -= popover.offsetWidth / 2;
}
this.topPosition = this.keyPosition.top + this.keyPosition.height + 7;
// 7 is a space between a bottom key position and a popover
this.topPosition = this.keyPosition.top + this.keyPosition.height + 7 + window.scrollY;
this.leftPosition = newLeft;
}
}

View File

@@ -1,6 +1,10 @@
:host {
width: 100%;
display: block;
&.space {
margin-bottom: 405px;
}
}
svg-keyboard {

View File

@@ -2,6 +2,7 @@ import {
ChangeDetectionStrategy,
Component,
ElementRef,
HostBinding,
HostListener,
Input,
OnChanges,
@@ -107,6 +108,10 @@ export class SvgKeyboardWrapComponent implements OnInit, OnChanges {
private wrapHost: HTMLElement;
private keyElement: HTMLElement;
@HostBinding('class.space') get space() {
return this.popoverEnabled;
}
@HostListener('window:resize')
onResize() {
if (this.wrapHost) {

View File

@@ -1,6 +1,6 @@
main-app {
display: block;
height: 100vh;
min-height: 100vh;
width: 100%;
overflow: hidden;
position: relative;
@@ -11,7 +11,6 @@ main-app {
}
.main-content {
height: 100%;
margin-left: 250px;
}