Skip to content

Commit

Permalink
feat(*): add delay before showing the tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed Nov 23, 2017
1 parent 699a85b commit ed45862
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<md-list-item>
<md-icon md-list-avatar>layers</md-icon>
<h4 md-line [md-tooltip]="layer.title">{{layer.title}}</h4>
<h4 md-line
[md-tooltip]="layer.title"
mdTooltipShowDelay="500">
{{layer.title}}
</h4>
</md-list-item>
7 changes: 7 additions & 0 deletions src/lib/context/context-item/context-item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
md-icon-button
igoStopPropagation
[md-tooltip]="'igo.context.favorite' | translate"
mdTooltipShowDelay="500"
[color]="default ? 'primary' : 'default'"
(click)="favorite.emit(context)">
<md-icon>
Expand All @@ -18,6 +19,7 @@ <h4 mdLine>{{context.title}}</h4>
<button
md-icon-button
[md-tooltip]="'igo.context.clone' | translate"
mdTooltipShowDelay="500"
[color]="color"
(click)="clone.emit(context)">
<md-icon>content_copy</md-icon>
Expand All @@ -32,6 +34,7 @@ <h4 mdLine>{{context.title}}</h4>
<button *ngIf="collapsed"
md-icon-button
[md-tooltip]="'igo.context.save' | translate"
mdTooltipShowDelay="500"
[color]="color"
(click)="save.emit(context)">
<md-icon>save</md-icon>
Expand All @@ -42,6 +45,7 @@ <h4 mdLine>{{context.title}}</h4>
<button
md-icon-button
[md-tooltip]="'igo.context.managePermissions' | translate"
mdTooltipShowDelay="500"
[color]="color"
(click)="managePermissions.emit(context)">
<md-icon>perm_identity</md-icon>
Expand All @@ -58,6 +62,7 @@ <h4 mdLine>{{context.title}}</h4>
<button
md-icon-button
[md-tooltip]="'igo.context.clone' | translate"
mdTooltipShowDelay="500"
[color]="color"
(click)="clone.emit(context)">
<md-icon>content_copy</md-icon>
Expand All @@ -67,6 +72,7 @@ <h4 mdLine>{{context.title}}</h4>
md-icon-button
[color]="color"
[md-tooltip]="'igo.context.edit' | translate"
mdTooltipShowDelay="500"
(click)="edit.emit(context)">
<md-icon>edit</md-icon>
</button>
Expand All @@ -75,6 +81,7 @@ <h4 mdLine>{{context.title}}</h4>
md-icon-button
color="warn"
[md-tooltip]="'igo.context.delete' | translate"
mdTooltipShowDelay="500"
(click)="delete.emit(context)">
<md-icon>delete</md-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ <h4 md-line>{{permission.profil}}</h4>
<button
md-icon-button
[md-tooltip]="'igo.permission.delete' | translate"
mdTooltipShowDelay="500"
color="warn"
(click)="removePermission.emit(permission)">
<md-icon>delete</md-icon>
Expand Down
8 changes: 7 additions & 1 deletion src/lib/layer/layer-item/layer-item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
[collapsed]="layer.collapsed"
(toggle)="toggleLegend($event)">
</md-icon>
<h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
<h4 mdLine [md-tooltip]="layer.title" mdTooltipShowDelay="500">{{layer.title}}</h4>

<button
md-icon-button
collapsibleButton
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="layer.visible ?
('igo.layer.hideLayer' | translate) :
('igo.layer.showLayer' | translate)"
Expand Down Expand Up @@ -50,6 +51,7 @@ <h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
[max]="100"
[(ngModel)]="opacity"
[md-tooltip]="'igo.layer.opacity' | translate"
mdTooltipShowDelay="500"
tooltip-position="below">
</md-slider>
</div>
Expand All @@ -60,6 +62,7 @@ <h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
*ngIf="layer.dataSource.options.metadata && layer.dataSource.options.metadata.url"
md-icon-button
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="'igo.layer.showMetadata' | translate"
[color]="color"
(click)="openMetadata(layer.dataSource.options.metadata)">
Expand All @@ -69,6 +72,7 @@ <h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
<button
md-icon-button
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="'igo.layer.raiseLayer' | translate"
[color]="color"
(click)="layer.map.raiseLayer(layer)">
Expand All @@ -78,6 +82,7 @@ <h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
<button
md-icon-button
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="'igo.layer.lowerLayer' | translate"
[color]="color"
(click)="layer.map.lowerLayer(layer)">
Expand All @@ -87,6 +92,7 @@ <h4 mdLine [md-tooltip]="layer.title">{{layer.title}}</h4>
<button
md-icon-button
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="'igo.layer.removeLayer' | translate"
color="warn"
(click)="layer.map.removeLayer(layer)">
Expand Down
9 changes: 8 additions & 1 deletion src/lib/tool/toolbar-item/toolbar-item.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<md-list-item
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="tool.tooltip | translate"
(select)="select.emit(tool)">
<md-icon *ngIf="withIcon" md-list-avatar>{{tool.icon}}</md-icon>
<md-icon *ngIf="withIcon"
md-list-avatar
tooltip-position="below"
mdTooltipShowDelay="500"
[md-tooltip]="(tool.tooltip || tool.title) | translate">
{{tool.icon}}
</md-icon>
<h4 *ngIf="withTitle" mdLine>{{tool.title | translate}}</h4>
</md-list-item>

0 comments on commit ed45862

Please sign in to comment.