diff --git a/src/components/Event.vue b/src/components/Event.vue index a096783a..d9d5460f 100644 --- a/src/components/Event.vue +++ b/src/components/Event.vue @@ -53,7 +53,7 @@ - + diff --git a/src/components/event/LastEvents.vue b/src/components/event/LastEvents.vue index 48a6d19e..563b7245 100644 --- a/src/components/event/LastEvents.vue +++ b/src/components/event/LastEvents.vue @@ -64,9 +64,9 @@ this.$http.get(apiSettings.endpointEvents, { params: { datetime_min: this.$moment.utc().subtract(6, 'months').format('YYYY-MM-DD 00:00:00'), - has_training: this.event.has_training ? 1 : 0, - include: 'nearestCity', - limit: 10 + has_training: !this.event || !this.event.has_training ? 0 : 1, + limit: this.$root.onMobile ? 20 : 10, + include: 'nearestCity' } }) .then(response => { @@ -93,15 +93,8 @@ return false } }, - watch: { - event: function(data) { - if (this.inited === true) return - this.inited = true - this.fetchEvents() - } - }, created() { - + this.fetchEvents() } } diff --git a/src/components/maps/Buildings.vue b/src/components/maps/Buildings.vue index a8016cb7..0848eb5a 100644 --- a/src/components/maps/Buildings.vue +++ b/src/components/maps/Buildings.vue @@ -173,25 +173,22 @@ putEpicenter: function() { this.map.epicenter = addEpicenter(this.map.object, this.coordinates) }, - removeData: function() - { - // Remove building markers. - if (this.map.markerCluster) { - this.map.object.removeLayer(this.map.markerCluster) - } - }, resetMap: function() { let map = this.map.object removeEpicenter(map, this.map.epicenter) + // Remove building markers. + if (this.map.markerCluster) { + map.removeLayer(this.map.markerCluster) + } + + // Remove controls overlays. this.map.makerksGroups.forEach(makerksGroup => { map._controls.removeLayer(makerksGroup) }) - this.removeData() - setView(map, this.coordinates) } },