Merge pull request #2268 from dpalou/MOBILE-3337-int

MOBILE-3337 desktop: Hide 'My location' button in desktop
main
Juan Leyva 2020-02-07 15:46:15 +01:00 committed by GitHub
commit b82e641420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,7 @@
<ion-input type="text" [formControlName]="'f_'+field.id+'_1'" maxlength="10"></ion-input>
<span class="placeholder-icon" item-right>°E</span>
</div>
<div *ngIf="mode == 'edit'" class="addon-data-lantlong">
<div *ngIf="mode == 'edit' && showGeolocation" class="addon-data-lantlong">
<button ion-button icon-left (click)="getLocation($event)">
<ion-icon name="locate"></ion-icon>
{{ 'addon.mod_data.mylocation' | translate }}

View File

@ -17,6 +17,7 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { Platform } from 'ionic-angular';
import { Geolocation, GeolocationOptions } from '@ionic-native/geolocation';
import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin-component';
import { CoreAppProvider } from '@providers/app';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
/**
@ -30,13 +31,17 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginCo
north: number;
east: number;
showGeolocation: boolean;
constructor(protected fb: FormBuilder,
protected platform: Platform,
protected geolocation: Geolocation,
protected domUtils: CoreDomUtilsProvider,
protected sanitizer: DomSanitizer) {
protected sanitizer: DomSanitizer,
protected appProvider: CoreAppProvider) {
super(fb);
this.showGeolocation = !this.appProvider.isDesktop();
}
/**