Skip to content

Commit 66aac6c

Browse files
authored
Version 0.3.1 (#115)
* Fixed Popup reaction on `showed` prop changes
1 parent 514b2fa commit 66aac6c

File tree

6 files changed

+80
-49
lines changed

6 files changed

+80
-49
lines changed

dist/vue-mapbox.common.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,8 +3823,8 @@ module.exports = /******/ (function(modules) {
38233823

38243824
Marker_component.options.__file = "Marker.vue";
38253825
/* harmony default export */ var Marker = Marker_component.exports;
3826-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=template&id=6abc114a&
3827-
var Popupvue_type_template_id_6abc114a_render = function() {
3826+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=template&id=6e79a273&
3827+
var Popupvue_type_template_id_6e79a273_render = function() {
38283828
var _vm = this;
38293829
var _h = _vm.$createElement;
38303830
var _c = _vm._self._c || _h;
@@ -3835,9 +3835,9 @@ module.exports = /******/ (function(modules) {
38353835
2
38363836
);
38373837
};
3838-
var Popupvue_type_template_id_6abc114a_staticRenderFns = [];
3838+
var Popupvue_type_template_id_6e79a273_staticRenderFns = [];
38393839

3840-
// CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6abc114a&
3840+
// CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6e79a273&
38413841

38423842
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=script&lang=js&
38433843

@@ -3970,6 +3970,21 @@ module.exports = /******/ (function(modules) {
39703970
}
39713971
}
39723972
},
3973+
watch: {
3974+
coordinates: function coordinates(lngLat) {
3975+
if (this.initial) return;
3976+
this.popup.setLngLat(lngLat);
3977+
},
3978+
showed: function showed(next, prev) {
3979+
if (next !== prev) {
3980+
this.open = next;
3981+
3982+
if (this.marker) {
3983+
this.marker.togglePopup();
3984+
}
3985+
}
3986+
}
3987+
},
39733988
created: function created() {
39743989
this.popup = new this.mapbox.Popup(this.$props);
39753990
},
@@ -3983,12 +3998,6 @@ module.exports = /******/ (function(modules) {
39833998
this.$_emitEvent("removed");
39843999
}
39854000
},
3986-
watch: {
3987-
coordinates: function coordinates(lngLat) {
3988-
if (this.initial) return;
3989-
this.popup.setLngLat(lngLat);
3990-
}
3991-
},
39924001
methods: {
39934002
$_addPopup: function $_addPopup() {
39944003
this.popup = new this.mapbox.Popup(this.$props);
@@ -4049,8 +4058,8 @@ module.exports = /******/ (function(modules) {
40494058

40504059
var Popup_component = normalizeComponent(
40514060
UI_Popupvue_type_script_lang_js_,
4052-
Popupvue_type_template_id_6abc114a_render,
4053-
Popupvue_type_template_id_6abc114a_staticRenderFns,
4061+
Popupvue_type_template_id_6e79a273_render,
4062+
Popupvue_type_template_id_6e79a273_staticRenderFns,
40544063
false,
40554064
null,
40564065
null,

dist/vue-mapbox.umd.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3871,8 +3871,8 @@
38713871

38723872
Marker_component.options.__file = "Marker.vue";
38733873
/* harmony default export */ var Marker = Marker_component.exports;
3874-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=template&id=6abc114a&
3875-
var Popupvue_type_template_id_6abc114a_render = function() {
3874+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"47f5d000-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=template&id=6e79a273&
3875+
var Popupvue_type_template_id_6e79a273_render = function() {
38763876
var _vm = this;
38773877
var _h = _vm.$createElement;
38783878
var _c = _vm._self._c || _h;
@@ -3883,9 +3883,9 @@
38833883
2
38843884
);
38853885
};
3886-
var Popupvue_type_template_id_6abc114a_staticRenderFns = [];
3886+
var Popupvue_type_template_id_6e79a273_staticRenderFns = [];
38873887

3888-
// CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6abc114a&
3888+
// CONCATENATED MODULE: ./src/components/UI/Popup.vue?vue&type=template&id=6e79a273&
38893889

38903890
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/Popup.vue?vue&type=script&lang=js&
38913891

@@ -4020,6 +4020,21 @@
40204020
}
40214021
}
40224022
},
4023+
watch: {
4024+
coordinates: function coordinates(lngLat) {
4025+
if (this.initial) return;
4026+
this.popup.setLngLat(lngLat);
4027+
},
4028+
showed: function showed(next, prev) {
4029+
if (next !== prev) {
4030+
this.open = next;
4031+
4032+
if (this.marker) {
4033+
this.marker.togglePopup();
4034+
}
4035+
}
4036+
}
4037+
},
40234038
created: function created() {
40244039
this.popup = new this.mapbox.Popup(this.$props);
40254040
},
@@ -4033,12 +4048,6 @@
40334048
this.$_emitEvent("removed");
40344049
}
40354050
},
4036-
watch: {
4037-
coordinates: function coordinates(lngLat) {
4038-
if (this.initial) return;
4039-
this.popup.setLngLat(lngLat);
4040-
}
4041-
},
40424051
methods: {
40434052
$_addPopup: function $_addPopup() {
40444053
this.popup = new this.mapbox.Popup(this.$props);
@@ -4099,8 +4108,8 @@
40994108

41004109
var Popup_component = normalizeComponent(
41014110
UI_Popupvue_type_script_lang_js_,
4102-
Popupvue_type_template_id_6abc114a_render,
4103-
Popupvue_type_template_id_6abc114a_staticRenderFns,
4111+
Popupvue_type_template_id_6e79a273_render,
4112+
Popupvue_type_template_id_6e79a273_staticRenderFns,
41044113
false,
41054114
null,
41064115
null,

dist/vue-mapbox.umd.min.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,11 @@
747747
);
748748
} catch (r) {}
749749
})(),
750-
T = function(t) {
750+
P = function(t) {
751751
var e;
752752
return !(!d(t) || "function" != typeof (e = t.then)) && e;
753753
},
754-
P = function(t, e) {
754+
T = function(t, e) {
755755
if (!t._n) {
756756
t._n = !0;
757757
var n = t._c;
@@ -777,7 +777,7 @@
777777
f && (f.exit(), (a = !0))),
778778
n === e.promise
779779
? u(I("Promise-chain cycle"))
780-
: (i = T(n))
780+
: (i = P(n))
781781
? i.call(n, c, u)
782782
: c(n))
783783
: u(r);
@@ -834,7 +834,7 @@
834834
(e._v = t),
835835
(e._s = 2),
836836
e._a || (e._a = e._c.slice()),
837-
P(e, !0));
837+
T(e, !0));
838838
},
839839
N = function(t) {
840840
var e,
@@ -843,7 +843,7 @@
843843
(n._d = !0), (n = n._w || n);
844844
try {
845845
if (n === t) throw I("Promise can't be resolved itself");
846-
(e = T(t))
846+
(e = P(t))
847847
? g(function() {
848848
var r = { _w: n, _d: !1 };
849849
try {
@@ -852,7 +852,7 @@
852852
R.call(r, o);
853853
}
854854
})
855-
: ((n._v = t), (n._s = 1), P(n, !1));
855+
: ((n._v = t), (n._s = 1), T(n, !1));
856856
} catch (r) {
857857
R.call({ _w: n, _d: !1 }, r);
858858
}
@@ -885,7 +885,7 @@
885885
(n.domain = M ? w.domain : void 0),
886886
this._c.push(n),
887887
this._a && this._a.push(n),
888-
this._s && P(this, !1),
888+
this._s && T(this, !1),
889889
n.promise
890890
);
891891
},
@@ -2349,7 +2349,7 @@
23492349
this.$_addControl();
23502350
}
23512351
},
2352-
T = {
2352+
P = {
23532353
name: "ScaleControl",
23542354
mixins: [L],
23552355
props: {
@@ -2372,7 +2372,7 @@
23722372
this.$_addControl();
23732373
}
23742374
},
2375-
P = function() {
2375+
T = function() {
23762376
var t = this,
23772377
e = t.$createElement,
23782378
n = t._self._c || e;
@@ -2461,7 +2461,7 @@
24612461
}
24622462
},
24632463
R = A,
2464-
N = $(R, P, B, !1, null, null, null);
2464+
N = $(R, T, B, !1, null, null, null);
24652465
N.options.__file = "Marker.vue";
24662466
var z = N.exports,
24672467
U = function() {
@@ -2529,6 +2529,15 @@
25292529
}
25302530
}
25312531
},
2532+
watch: {
2533+
coordinates: function(t) {
2534+
this.initial || this.popup.setLngLat(t);
2535+
},
2536+
showed: function(t, e) {
2537+
t !== e &&
2538+
((this.open = t), this.marker && this.marker.togglePopup());
2539+
}
2540+
},
25322541
created: function() {
25332542
this.popup = new this.mapbox.Popup(this.$props);
25342543
},
@@ -2538,11 +2547,6 @@
25382547
beforeDestroy: function() {
25392548
this.map && (this.popup.remove(), this.$_emitEvent("removed"));
25402549
},
2541-
watch: {
2542-
coordinates: function(t) {
2543-
this.initial || this.popup.setLngLat(t);
2544-
}
2545-
},
25462550
methods: {
25472551
$_addPopup: function() {
25482552
if (
@@ -3197,7 +3201,7 @@
31973201
dt = j,
31983202
pt = k,
31993203
ht = C,
3200-
mt = T,
3204+
mt = P,
32013205
vt = Q,
32023206
yt = tt,
32033207
gt = et,

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-mapbox",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"author": {
55
"name": "soal",
66
"email": "sorrrow.about.alice@gmail.com",

src/components/UI/Popup.vue

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,22 @@ export default {
130130
}
131131
},
132132
133+
watch: {
134+
coordinates(lngLat) {
135+
if (this.initial) return;
136+
this.popup.setLngLat(lngLat);
137+
},
138+
139+
showed(next, prev) {
140+
if (next !== prev) {
141+
this.open = next;
142+
if (this.marker) {
143+
this.marker.togglePopup();
144+
}
145+
}
146+
}
147+
},
148+
133149
created() {
134150
this.popup = new this.mapbox.Popup(this.$props);
135151
},
@@ -146,13 +162,6 @@ export default {
146162
}
147163
},
148164
149-
watch: {
150-
coordinates(lngLat) {
151-
if (this.initial) return;
152-
this.popup.setLngLat(lngLat);
153-
}
154-
},
155-
156165
methods: {
157166
$_addPopup() {
158167
this.popup = new this.mapbox.Popup(this.$props);

0 commit comments

Comments
 (0)