Merge branch 'disable-geoloc-on-area-selection' into 'master'

Disable geolocation on prefered events area selection

See merge request framasoft/mobilizon!834
This commit is contained in:
Thomas Citharel 2021-03-02 09:50:21 +00:00
commit 511ffa55b4
2 changed files with 9 additions and 2 deletions

View File

@ -20,7 +20,7 @@
</template>
</b-autocomplete>
</b-field>
<b-field v-if="isSecureContext()">
<b-field v-if="canDoGeoLocation">
<b-button
type="is-text"
v-if="!gettingLocation"
@ -72,6 +72,8 @@ import { IConfig } from "../../types/config.model";
export default class AddressAutoComplete extends Vue {
@Prop({ required: true }) value!: IAddress;
@Prop({ required: false, default: false }) type!: string | false;
@Prop({ required: false, default: true, type: Boolean })
doGeoLocation!: boolean;
addressData: IAddress[] = [];
@ -244,9 +246,13 @@ export default class AddressAutoComplete extends Vue {
}
// eslint-disable-next-line class-methods-use-this
isSecureContext(): boolean {
get isSecureContext(): boolean {
return window.isSecureContext;
}
get canDoGeoLocation(): boolean {
return this.isSecureContext && this.doGeoLocation;
}
}
</script>
<style lang="scss">

View File

@ -63,6 +63,7 @@
loggedUser && loggedUser.settings && loggedUser.settings.location
"
:type="AddressSearchType.ADMINISTRATIVE"
:doGeoLocation="false"
v-model="address"
>
</address-auto-complete>