Merge pull request #2268 from dpalou/MOBILE-3337-int
MOBILE-3337 desktop: Hide 'My location' button in desktopmain
commit
b82e641420
|
@ -10,7 +10,7 @@
|
||||||
<ion-input type="text" [formControlName]="'f_'+field.id+'_1'" maxlength="10"></ion-input>
|
<ion-input type="text" [formControlName]="'f_'+field.id+'_1'" maxlength="10"></ion-input>
|
||||||
<span class="placeholder-icon" item-right>°E</span>
|
<span class="placeholder-icon" item-right>°E</span>
|
||||||
</div>
|
</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)">
|
<button ion-button icon-left (click)="getLocation($event)">
|
||||||
<ion-icon name="locate"></ion-icon>
|
<ion-icon name="locate"></ion-icon>
|
||||||
{{ 'addon.mod_data.mylocation' | translate }}
|
{{ 'addon.mod_data.mylocation' | translate }}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
|
||||||
import { Platform } from 'ionic-angular';
|
import { Platform } from 'ionic-angular';
|
||||||
import { Geolocation, GeolocationOptions } from '@ionic-native/geolocation';
|
import { Geolocation, GeolocationOptions } from '@ionic-native/geolocation';
|
||||||
import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin-component';
|
import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin-component';
|
||||||
|
import { CoreAppProvider } from '@providers/app';
|
||||||
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,13 +31,17 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginCo
|
||||||
|
|
||||||
north: number;
|
north: number;
|
||||||
east: number;
|
east: number;
|
||||||
|
showGeolocation: boolean;
|
||||||
|
|
||||||
constructor(protected fb: FormBuilder,
|
constructor(protected fb: FormBuilder,
|
||||||
protected platform: Platform,
|
protected platform: Platform,
|
||||||
protected geolocation: Geolocation,
|
protected geolocation: Geolocation,
|
||||||
protected domUtils: CoreDomUtilsProvider,
|
protected domUtils: CoreDomUtilsProvider,
|
||||||
protected sanitizer: DomSanitizer) {
|
protected sanitizer: DomSanitizer,
|
||||||
|
protected appProvider: CoreAppProvider) {
|
||||||
super(fb);
|
super(fb);
|
||||||
|
|
||||||
|
this.showGeolocation = !this.appProvider.isDesktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue