-
Notifications
You must be signed in to change notification settings - Fork 65
Add help button to modal header #1144
Changes from 18 commits
c91b21a
d0b09e4
ea716d5
e108ae9
e364107
0e0dca0
e1d4ce5
08da56c
b36a567
6c9edec
bf485af
76f33f2
bcf506e
9ea609c
12eb50d
5e11169
a672032
705a9a6
971e631
3c72e95
93217ce
5e5f19b
81b3870
ae134e7
1ac1dfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export class SkyModalDemoContext { | ||
public valueA: string; | ||
public eventMessage?: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ export class SkyModalInstance { | |
public componentInstance: any; | ||
|
||
public closed = new EventEmitter<SkyModalCloseArgs>(); | ||
public helpInvoked = new EventEmitter<any>(); | ||
|
||
public close(result?: any, reason?: string) { | ||
if (reason === undefined) { | ||
|
@@ -27,6 +28,10 @@ export class SkyModalInstance { | |
this.closeModal('save', result); | ||
} | ||
|
||
public openHelp(helpKey?: string) { | ||
this.helpInvoked.emit(helpKey); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer the public method's name was more similar to the emitter ( |
||
} | ||
|
||
private closeModal(type: string, result?: any) { | ||
const args = new SkyModalCloseArgs(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,9 @@ | |
<ng-content select="sky-modal-header"></ng-content> | ||
</div> | ||
<div class="sky-modal-header-buttons"> | ||
<button *ngIf="helpKey !== undefined" type="button" class="sky-btn" name="help-button" [attr.aria-label]="'open_help' | skyResources" (click)="helpButtonClick()"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be sufficient, the difference would be that |
||
<i class="fa fa-question-circle"></i> | ||
</button> | ||
|
||
<button type="button" class="sky-btn sky-modal-btn-close" [attr.aria-label]="'modal_close' | skyResources" (click)="closeButtonClick()"> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that none of these subscriptions are unsubscribed during
ngOnDestroy
. Do you mind adding this to the component to see if it works?