Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tooltip): adds implementation to tooltipEnable #517

Merged
merged 1 commit into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/tooltip/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class TooltipDirective implements OnInit {
- `tooltipAnimation` (`?boolean=true`) - if `false` fade tooltip animation will be disabled
- `tooltipPopupDelay` (*not implemented*) (`?numer=0`) - time in milliseconds before tooltip occurs
- `tooltipTrigger` (*not implemented*) (`?Array<string>`) - array of event names which triggers tooltip opening
- `tooltipEnable` (*not implemented*) (`?boolean=true`) - if `false` tooltip is disabled and will not be shown
- `tooltipEnable` (`?boolean=true`) - if `false` tooltip is disabled and will not be shown
- `tooltipAppendToBody` (*not implemented*) (`?boolean=false`) - if `true` tooltip will be appended to body
- `tooltipClass` (*not implemented*) (`?string`) - custom tooltip class applied to the tooltip container.
- `tooltipIsOpen` (`?boolean=false`) - if `true` tooltip is currently visible
4 changes: 2 additions & 2 deletions components/tooltip/tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class TooltipDirective {
@Input('tooltip') public content:string;
@Input('tooltipPlacement') public placement:string = 'top';
@Input('tooltipIsOpen') public isOpen:boolean;
@Input('tooltipEnable') public enable:boolean;
@Input('tooltipEnable') public enable:boolean = true;
@Input('tooltipAnimation') public animation:boolean = true;
@Input('tooltipAppendToBody') public appendToBody:boolean;
/* tslint:enable */
Expand All @@ -32,7 +32,7 @@ export class TooltipDirective {
@HostListener('focusin', ['$event', '$target'])
@HostListener('mouseenter', ['$event', '$target'])
public show():void {
if (this.visible) {
if (this.visible || !this.enable) {
return;
}
this.visible = true;
Expand Down
4 changes: 2 additions & 2 deletions demo/components/tooltip/tooltip-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

<div class="form-group" ngClass="{'has-error' : !inputModel}">
<label>Disable tooltips conditionally:</label>
<input type="text" ngModel="inputModel" class="form-control"
<input type="text" [(ngModel)]="inputModel" class="form-control"
placeholder="Hover over this for a tooltip until this is filled"
tooltip="Enter something in this input field to disable this tooltip"
tooltipPlacement="top"
tooltipTrigger="mouseenter"
tooltipEnable="!inputModel" />
[tooltipEnable]="!inputModel || inputModel.length==0" />
</div>
</form>