Skip to content

Commit

Permalink
Merge pull request #349 from armd-pro/master
Browse files Browse the repository at this point in the history
 Последние события на главной для мобильных.
  • Loading branch information
jamm1985 authored Mar 3, 2019
2 parents 61f31d4 + c5b0e5c commit 53723e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/components/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

<b-col cols="4">
<keep-alive>
<component :is="components.lastEvents" :event="event" v-if="!$root.onMobile" />
<component :is="components.lastEvents" :event="event" v-if="!$root.onMobile && !!event.id" />
</keep-alive>
</b-col>

Expand Down
15 changes: 4 additions & 11 deletions src/components/event/LastEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -93,15 +93,8 @@
return false
}
},
watch: {
event: function(data) {
if (this.inited === true) return
this.inited = true
this.fetchEvents()
}
},
created() {
this.fetchEvents()
}
}
</script>
Expand Down
15 changes: 6 additions & 9 deletions src/components/maps/Buildings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
Expand Down

0 comments on commit 53723e2

Please sign in to comment.