From 92450eb82837f061b6c58480c65a0a9c6e935ba6 Mon Sep 17 00:00:00 2001 From: Arman Badalyan Date: Sat, 2 Mar 2019 17:40:39 +0800 Subject: [PATCH 1/4] Bugfix buildings map controls overlays reset. --- src/components/maps/Buildings.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/maps/Buildings.vue b/src/components/maps/Buildings.vue index a8016cb7..ebe8db65 100644 --- a/src/components/maps/Buildings.vue +++ b/src/components/maps/Buildings.vue @@ -179,20 +179,17 @@ if (this.map.markerCluster) { this.map.object.removeLayer(this.map.markerCluster) } - }, - resetMap: function() - { - let map = this.map.object - - removeEpicenter(map, this.map.epicenter) + // Remove controls overlays. this.map.makerksGroups.forEach(makerksGroup => { - map._controls.removeLayer(makerksGroup) + this.map.object._controls.removeLayer(makerksGroup) }) - + }, + resetMap: function() + { + removeEpicenter(this.map.object, this.map.epicenter) this.removeData() - - setView(map, this.coordinates) + setView(this.map.object, this.coordinates) } }, created() { From 024abafba094063e19464d5b2cf9e3983dcdc7f6 Mon Sep 17 00:00:00 2001 From: Arman Badalyan Date: Sat, 2 Mar 2019 23:20:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9F=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/event/LastEvents.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/event/LastEvents.vue b/src/components/event/LastEvents.vue index 48a6d19e..d83b625b 100644 --- a/src/components/event/LastEvents.vue +++ b/src/components/event/LastEvents.vue @@ -64,7 +64,7 @@ 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, + has_training: !this.event || !this.event.has_training ? 0 : 1, include: 'nearestCity', limit: 10 } From 00b8d93b690e47a551fd4c5eeaf2089c1eb11a46 Mon Sep 17 00:00:00 2001 From: Arman Badalyan Date: Sun, 3 Mar 2019 09:15:47 +0800 Subject: [PATCH 3/4] Bugfix buildings map controls overlays reset. --- src/components/Event.vue | 2 +- src/components/event/LastEvents.vue | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) 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 d83b625b..563b7245 100644 --- a/src/components/event/LastEvents.vue +++ b/src/components/event/LastEvents.vue @@ -65,8 +65,8 @@ params: { datetime_min: this.$moment.utc().subtract(6, 'months').format('YYYY-MM-DD 00:00:00'), has_training: !this.event || !this.event.has_training ? 0 : 1, - include: 'nearestCity', - limit: 10 + 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() } } From c5b0e5c9206800fa572edfc57e786cf1a606e199 Mon Sep 17 00:00:00 2001 From: Arman Badalyan Date: Sun, 3 Mar 2019 09:26:51 +0800 Subject: [PATCH 4/4] Bugfix buildings map controls overlays reset. --- src/components/maps/Buildings.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/maps/Buildings.vue b/src/components/maps/Buildings.vue index ebe8db65..0848eb5a 100644 --- a/src/components/maps/Buildings.vue +++ b/src/components/maps/Buildings.vue @@ -173,23 +173,23 @@ putEpicenter: function() { this.map.epicenter = addEpicenter(this.map.object, this.coordinates) }, - removeData: function() + resetMap: function() { + let map = this.map.object + + removeEpicenter(map, this.map.epicenter) + // Remove building markers. if (this.map.markerCluster) { - this.map.object.removeLayer(this.map.markerCluster) + map.removeLayer(this.map.markerCluster) } // Remove controls overlays. this.map.makerksGroups.forEach(makerksGroup => { - this.map.object._controls.removeLayer(makerksGroup) + map._controls.removeLayer(makerksGroup) }) - }, - resetMap: function() - { - removeEpicenter(this.map.object, this.map.epicenter) - this.removeData() - setView(this.map.object, this.coordinates) + + setView(map, this.coordinates) } }, created() {