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

View file

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