mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-02 10:22:09 +00:00
Better event for location.
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
:submitted-transaction="submittedTransaction"
|
:submitted-transaction="submittedTransaction"
|
||||||
v-on:uploaded-attachments="uploadedAttachment($event)"
|
v-on:uploaded-attachments="uploadedAttachment($event)"
|
||||||
v-on:set-description="storeField($event)"
|
v-on:set-description="storeField($event)"
|
||||||
v-on:set-marker-location="storeLocation(index, $event)"
|
v-on:set-marker-location="storeLocation($event)"
|
||||||
v-on:set-source-account-id="storeAccountValue(index, 'source', 'id', $event)"
|
v-on:set-source-account-id="storeAccountValue(index, 'source', 'id', $event)"
|
||||||
v-on:set-source-account-name="storeAccountValue(index, 'source', 'name', $event)"
|
v-on:set-source-account-name="storeAccountValue(index, 'source', 'name', $event)"
|
||||||
v-on:set-source-account-type="storeAccountValue(index, 'source', 'type', $event)"
|
v-on:set-source-account-type="storeAccountValue(index, 'source', 'type', $event)"
|
||||||
@@ -388,13 +388,13 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* Responds to changed location.
|
* Responds to changed location.
|
||||||
*/
|
*/
|
||||||
storeLocation: function (index, event) {
|
storeLocation: function (payload) {
|
||||||
let zoomLevel = event.hasMarker ? event.zoomLevel : null;
|
let zoomLevel = payload.hasMarker ? payload.zoomLevel : null;
|
||||||
let lat = event.hasMarker ? event.lat : null;
|
let lat = payload.hasMarker ? payload.lat : null;
|
||||||
let lng = event.hasMarker ? event.lng : null;
|
let lng = payload.hasMarker ? payload.lng : null;
|
||||||
this.updateField({index: index, field: 'zoom_level', value: zoomLevel});
|
this.updateField({index: payload.index, field: 'zoom_level', value: zoomLevel});
|
||||||
this.updateField({index: index, field: 'latitude', value: lat});
|
this.updateField({index: payload.index, field: 'latitude', value: lat});
|
||||||
this.updateField({index: index, field: 'longitude', value: lng});
|
this.updateField({index: payload.index, field: 'longitude', value: lng});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Responds to changed account.
|
* Responds to changed account.
|
||||||
|
@@ -112,7 +112,14 @@ export default {
|
|||||||
this.emitEvent();
|
this.emitEvent();
|
||||||
},
|
},
|
||||||
emitEvent() {
|
emitEvent() {
|
||||||
this.$emit('set-marker-location', {zoomLevel: this.zoom, lat: this.marker[0], lng: this.marker[1], hasMarker: this.hasMarker});
|
this.$emit('set-marker-location', {
|
||||||
|
index: this.index,
|
||||||
|
zoomLevel: this.zoom,
|
||||||
|
lat: this.marker[0],
|
||||||
|
lng: this.marker[1],
|
||||||
|
hasMarker: this.hasMarker
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
zoomUpdated(zoom) {
|
zoomUpdated(zoom) {
|
||||||
this.zoom = zoom;
|
this.zoom = zoom;
|
||||||
|
Reference in New Issue
Block a user