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

tooltip fix to not show on mobile #1696

Closed
wants to merge 5 commits into from
Closed
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
16 changes: 14 additions & 2 deletions ui/src/app/modules/plugins/plugin-card/plugin-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,29 @@ <h4 class="card-title mb-0">

<div class="ml-auto">
<a href="javascript:void(0)" class="card-link text-decoration-none ml-3"
*ngIf="plugin.updateAvailable && !plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin)"
*ngIf="!mobileDevice && plugin.updateAvailable && !plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin)"
placement="bottom" ngbTooltip="{{'plugins.tooltip_update_plugin_to' | translate:plugin }}" container="body"
[openDelay]="150" [closeDelay]="3000" [autoClose]="true" [translate]="'plugins.button_update'" triggers="hover:focus:touchstart:touchend:click">
<i class="fas fa-fw fa-arrow-alt-circle-up primary-text"></i>
</a>
<a href="javascript:void(0)" class="card-link text-decoration-none ml-3"
*ngIf="!plugin.updateAvailable && plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin, 'beta')"
*ngIf="!mobileDevice $$ !plugin.updateAvailable && plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin, 'beta')"
placement="bottom" ngbTooltip="{{'plugins.tooltip_update_plugin_to' | translate:plugin }}" container="body"
[openDelay]="150" [closeDelay]="3000" [autoClose]="true" [translate]="'plugins.button_update'" triggers="hover:focus:touchstart:touchend:click">
<i class="fas fa-fw fa-arrow-alt-circle-up primary-text"></i>
</a>
<a href="javascript:void(0)" class="card-link text-decoration-none ml-3"
*ngIf="mobileDevice && plugin.updateAvailable && !plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin)"
placement="bottom" ngbTooltip="" container="body"
[translate]="'plugins.button_update'">
<i class="fas fa-fw fa-arrow-alt-circle-up primary-text"></i>
</a>
<a href="javascript:void(0)" class="card-link text-decoration-none ml-3"
*ngIf="mobileDevice $$ !plugin.updateAvailable && plugin.betaUpdateAvailable" (click)="$plugin.updatePlugin(plugin, 'beta')"
placement="bottom" ngbTooltip="" container="body"
[translate]="'plugins.button_update'">
<i class="fas fa-fw fa-arrow-alt-circle-up primary-text"></i>
</a>
<ng-container *ngIf="hasChildBridges">
<a href="javascript:void(0);" class="card-link grey-text ml-3" rel="noopener noreferrer"
aria-label="Connect to HomeKit"
Expand Down
17 changes: 16 additions & 1 deletion ui/src/app/modules/plugins/plugin-card/plugin-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,22 @@ export class PluginCardComponent implements OnInit {
private $md: MobileDetectService,
) { }

ngOnInit(): void {}
ngOnInit(): void {
// check if the homebridge version supports disabled plugins
this.canDisablePlugins = this.$settings.env.homebridgeVersion ?
gt(this.$settings.env.homebridgeVersion, '1.3.0-beta.46') : false;

// check if the homebridge version supports external bridges
this.canManageBridgeSettings = this.$settings.env.homebridgeVersion ?
gt(this.$settings.env.homebridgeVersion, '1.3.0-beta.47') : false;

// check if the homebridge version supports stopping / starting child bridges
this.canStopStartChildBridges = this.$settings.env.homebridgeVersion ?
gt(this.$settings.env.homebridgeVersion, '1.5.0-beta.1') : false;

// detect mobile
this.detectMobile = (('ontouchstart' in document.documentElement) || (window.screen.width <= 768)) ? true : false;
}

@Input() set childBridges(childBridges: any[]) {
this.hasChildBridges = childBridges.length > 0;
Expand Down
Loading