-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
examples-standalone/coffee-warehouse/src/app/components/menu-window/menu-window.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { ButtonComponent } from '@progress/kendo-angular-buttons'; | ||
import { accessibilityIcon, SVGIcon } from '@progress/kendo-svg-icons'; | ||
|
||
@Component({ | ||
selector: 'app-menu-window', | ||
template: ` | ||
<kendo-button | ||
#button | ||
[svgIcon]="a11yIcon" | ||
size="large" | ||
themeColor="inverse" | ||
(click)="toggle()"></kendo-button> | ||
<kendo-window *ngIf="show" | ||
[top]="top" | ||
[left]="left" | ||
[width]="400" | ||
(close)="show = false;"> | ||
Window content | ||
</kendo-window> | ||
` | ||
}) | ||
export class MenuWindowComponent implements OnInit { | ||
@ViewChild('button') public button: ButtonComponent; | ||
public a11yIcon: SVGIcon = accessibilityIcon; | ||
public show = false; | ||
public left: number; | ||
public top: number; | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { } | ||
|
||
public toggle(): void { | ||
if (!this.show) { | ||
const {bottom, left, width} = this.button.element.getBoundingClientRect(); | ||
this.top = bottom; | ||
this.left = left - 400 + width; | ||
} | ||
|
||
this.show = !this.show; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters