Skip to content

Commit fb15df1

Browse files
committed
MOBILE-3337 desktop: Hide 'My location' button in desktop
1 parent 235a504 commit fb15df1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/addon/mod/data/fields/latlong/component/addon-mod-data-field-latlong.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ion-input type="text" [formControlName]="'f_'+field.id+'_1'" maxlength="10"></ion-input>
1111
<span class="placeholder-icon" item-right>°E</span>
1212
</div>
13-
<div *ngIf="mode == 'edit'" class="addon-data-lantlong">
13+
<div *ngIf="mode == 'edit' && showGeolocation" class="addon-data-lantlong">
1414
<button ion-button icon-left (click)="getLocation($event)">
1515
<ion-icon name="locate"></ion-icon>
1616
{{ 'addon.mod_data.mylocation' | translate }}

src/addon/mod/data/fields/latlong/component/latlong.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
1717
import { Platform } from 'ionic-angular';
1818
import { Geolocation, GeolocationOptions } from '@ionic-native/geolocation';
1919
import { AddonModDataFieldPluginComponent } from '../../../classes/field-plugin-component';
20+
import { CoreAppProvider } from '@providers/app';
2021
import { CoreDomUtilsProvider } from '@providers/utils/dom';
2122

2223
/**
@@ -30,13 +31,17 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginCo
3031

3132
north: number;
3233
east: number;
34+
showGeolocation: boolean;
3335

3436
constructor(protected fb: FormBuilder,
3537
protected platform: Platform,
3638
protected geolocation: Geolocation,
3739
protected domUtils: CoreDomUtilsProvider,
38-
protected sanitizer: DomSanitizer) {
40+
protected sanitizer: DomSanitizer,
41+
protected appProvider: CoreAppProvider) {
3942
super(fb);
43+
44+
this.showGeolocation = !this.appProvider.isDesktop();
4045
}
4146

4247
/**

0 commit comments

Comments
 (0)