Skip to content

Commit

Permalink
Fixed #6575 Calendar: Expose API to toggle calendar from component
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Sep 6, 2019
1 parent 2330a9d commit 725c4f6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,18 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
}
}

toggle() {
if (!this.inline){
if (!this.overlayVisible) {
this.showOverlay();
this.inputfieldViewChild.nativeElement.focus();
}
else {
this.hideOverlay();
}
}
}

onOverlayAnimationStart(event: AnimationEvent) {
switch (event.toState) {
case 'visible':
Expand Down
20 changes: 20 additions & 0 deletions src/app/showcase/components/calendar/calendardemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,26 @@ <h3>Events</h3>
</table>
</div>

<h3>Methods</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>toggle</td>
<td>-</td>
<td>Toggles the visibility of the calendar.</td>
</tr>
</tbody>
</table>
</div>

<h3>Styling</h3>
<p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
<div class="doc-tablewrapper">
Expand Down

0 comments on commit 725c4f6

Please sign in to comment.