Skip to content

Commit

Permalink
Resolverd conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 12, 2018
2 parents 4763697 + c54b171 commit d838cc0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ tooltip.authentication-methods-to-use=Authentication Methods to Use
tooltip.ignore-auth-method=Ignore any SP-Requested Authentication Method
tooltip.omit-not-before-condition=Omit Not Before Condition
tooltip.responder-id=ResponderId
tooltip.instruction=Information icon - press spacebar to read additional information for this form field
tooltip.instruction=Information icon
tooltip.attribute-release-table=Attribute release table - select the attributes you want to release (default unchecked)
tooltip.metadata-filter-name=Metadata Filter Name
tooltip.metadata-filter-type=Metadata Filter Type
Expand Down
10 changes: 6 additions & 4 deletions ui/src/app/shared/component/info-icon.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<ng-template #tooltipContent>
<span #content>{{ description }}</span>
<span #content [attr.aria-label]="description" [id]="id">{{ description }}</span>
</ng-template>
<button class="btn btn-nostyle info-icon"
#toggle="ngbPopover"
[attr.aria-label]="'tooltip.instruction' | translate"
[attr.aria-expanded]="toggle.isOpen()"
[ngbPopover]="tooltipContent"
aria-haspopup="true">
[triggers]="triggers"
[placement]="placement"
[attr.aria-flowto]="id"
role="tooltip">
<i class="fa fa-fw fa-info-circle text-primary fa-lg"></i>
<span class="sr-only" translate="tooltip.instruction"></span>
</button>
</button>
17 changes: 16 additions & 1 deletion ui/src/app/shared/component/info-icon.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, ChangeDetectionStrategy, ElementRef, ViewChild } from '@angular/core';
import { Component, Input, ChangeDetectionStrategy, Renderer } from '@angular/core';
import { NgbPopover, NgbPopoverConfig } from '@ng-bootstrap/ng-bootstrap';

@Component({
selector: 'info-icon',
Expand All @@ -8,4 +9,18 @@ import { Component, Input, ChangeDetectionStrategy, ElementRef, ViewChild } from
})
export class InfoIconComponent {
@Input() description: string;

id: string = String.fromCharCode(65 + Math.floor(Math.random() * 26)) + Date.now().toString();

triggers = 'mouseenter:mouseleave focus:blur';
container = 'body';
placement = ['top'];

constructor(
private renderer: Renderer
) { }
focus(element): void {
console.log(element.elementRef.nativeElement);
this.renderer.invokeElementMethod(element.elementRef.nativeElement, 'focus');
}
}

0 comments on commit d838cc0

Please sign in to comment.