Skip to content

Commit

Permalink
Version 0.3.1 (#115)
Browse files Browse the repository at this point in the history
* Fixed Popup reaction on `showed` prop changes
  • Loading branch information
soal committed May 1, 2019
1 parent 514b2fa commit 66aac6c
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 49 deletions.
33 changes: 21 additions & 12 deletions dist/vue-mapbox.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3823,8 +3823,8 @@ module.exports = /******/ (function(modules) {

Marker_component.options.__file = "Marker.vue";
/* harmony default export */ var Marker = Marker_component.exports;
// 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&
var Popupvue_type_template_id_6abc114a_render = function() {
// 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&
var Popupvue_type_template_id_6e79a273_render = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
Expand All @@ -3835,9 +3835,9 @@ module.exports = /******/ (function(modules) {
2
);
};
var Popupvue_type_template_id_6abc114a_staticRenderFns = [];
var Popupvue_type_template_id_6e79a273_staticRenderFns = [];

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

// 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&

Expand Down Expand Up @@ -3970,6 +3970,21 @@ module.exports = /******/ (function(modules) {
}
}
},
watch: {
coordinates: function coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
},
showed: function showed(next, prev) {
if (next !== prev) {
this.open = next;

if (this.marker) {
this.marker.togglePopup();
}
}
}
},
created: function created() {
this.popup = new this.mapbox.Popup(this.$props);
},
Expand All @@ -3983,12 +3998,6 @@ module.exports = /******/ (function(modules) {
this.$_emitEvent("removed");
}
},
watch: {
coordinates: function coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
}
},
methods: {
$_addPopup: function $_addPopup() {
this.popup = new this.mapbox.Popup(this.$props);
Expand Down Expand Up @@ -4049,8 +4058,8 @@ module.exports = /******/ (function(modules) {

var Popup_component = normalizeComponent(
UI_Popupvue_type_script_lang_js_,
Popupvue_type_template_id_6abc114a_render,
Popupvue_type_template_id_6abc114a_staticRenderFns,
Popupvue_type_template_id_6e79a273_render,
Popupvue_type_template_id_6e79a273_staticRenderFns,
false,
null,
null,
Expand Down
33 changes: 21 additions & 12 deletions dist/vue-mapbox.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3871,8 +3871,8 @@

Marker_component.options.__file = "Marker.vue";
/* harmony default export */ var Marker = Marker_component.exports;
// 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&
var Popupvue_type_template_id_6abc114a_render = function() {
// 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&
var Popupvue_type_template_id_6e79a273_render = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
Expand All @@ -3883,9 +3883,9 @@
2
);
};
var Popupvue_type_template_id_6abc114a_staticRenderFns = [];
var Popupvue_type_template_id_6e79a273_staticRenderFns = [];

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

// 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&

Expand Down Expand Up @@ -4020,6 +4020,21 @@
}
}
},
watch: {
coordinates: function coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
},
showed: function showed(next, prev) {
if (next !== prev) {
this.open = next;

if (this.marker) {
this.marker.togglePopup();
}
}
}
},
created: function created() {
this.popup = new this.mapbox.Popup(this.$props);
},
Expand All @@ -4033,12 +4048,6 @@
this.$_emitEvent("removed");
}
},
watch: {
coordinates: function coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
}
},
methods: {
$_addPopup: function $_addPopup() {
this.popup = new this.mapbox.Popup(this.$props);
Expand Down Expand Up @@ -4099,8 +4108,8 @@

var Popup_component = normalizeComponent(
UI_Popupvue_type_script_lang_js_,
Popupvue_type_template_id_6abc114a_render,
Popupvue_type_template_id_6abc114a_staticRenderFns,
Popupvue_type_template_id_6e79a273_render,
Popupvue_type_template_id_6e79a273_staticRenderFns,
false,
null,
null,
Expand Down
36 changes: 20 additions & 16 deletions dist/vue-mapbox.umd.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,11 @@
);
} catch (r) {}
})(),
T = function(t) {
P = function(t) {
var e;
return !(!d(t) || "function" != typeof (e = t.then)) && e;
},
P = function(t, e) {
T = function(t, e) {
if (!t._n) {
t._n = !0;
var n = t._c;
Expand All @@ -777,7 +777,7 @@
f && (f.exit(), (a = !0))),
n === e.promise
? u(I("Promise-chain cycle"))
: (i = T(n))
: (i = P(n))
? i.call(n, c, u)
: c(n))
: u(r);
Expand Down Expand Up @@ -834,7 +834,7 @@
(e._v = t),
(e._s = 2),
e._a || (e._a = e._c.slice()),
P(e, !0));
T(e, !0));
},
N = function(t) {
var e,
Expand All @@ -843,7 +843,7 @@
(n._d = !0), (n = n._w || n);
try {
if (n === t) throw I("Promise can't be resolved itself");
(e = T(t))
(e = P(t))
? g(function() {
var r = { _w: n, _d: !1 };
try {
Expand All @@ -852,7 +852,7 @@
R.call(r, o);
}
})
: ((n._v = t), (n._s = 1), P(n, !1));
: ((n._v = t), (n._s = 1), T(n, !1));
} catch (r) {
R.call({ _w: n, _d: !1 }, r);
}
Expand Down Expand Up @@ -885,7 +885,7 @@
(n.domain = M ? w.domain : void 0),
this._c.push(n),
this._a && this._a.push(n),
this._s && P(this, !1),
this._s && T(this, !1),
n.promise
);
},
Expand Down Expand Up @@ -2349,7 +2349,7 @@
this.$_addControl();
}
},
T = {
P = {
name: "ScaleControl",
mixins: [L],
props: {
Expand All @@ -2372,7 +2372,7 @@
this.$_addControl();
}
},
P = function() {
T = function() {
var t = this,
e = t.$createElement,
n = t._self._c || e;
Expand Down Expand Up @@ -2461,7 +2461,7 @@
}
},
R = A,
N = $(R, P, B, !1, null, null, null);
N = $(R, T, B, !1, null, null, null);
N.options.__file = "Marker.vue";
var z = N.exports,
U = function() {
Expand Down Expand Up @@ -2529,6 +2529,15 @@
}
}
},
watch: {
coordinates: function(t) {
this.initial || this.popup.setLngLat(t);
},
showed: function(t, e) {
t !== e &&
((this.open = t), this.marker && this.marker.togglePopup());
}
},
created: function() {
this.popup = new this.mapbox.Popup(this.$props);
},
Expand All @@ -2538,11 +2547,6 @@
beforeDestroy: function() {
this.map && (this.popup.remove(), this.$_emitEvent("removed"));
},
watch: {
coordinates: function(t) {
this.initial || this.popup.setLngLat(t);
}
},
methods: {
$_addPopup: function() {
if (
Expand Down Expand Up @@ -3197,7 +3201,7 @@
dt = j,
pt = k,
ht = C,
mt = T,
mt = P,
vt = Q,
yt = tt,
gt = et,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-mapbox",
"version": "0.3.0",
"version": "0.3.1",
"author": {
"name": "soal",
"email": "sorrrow.about.alice@gmail.com",
Expand Down
23 changes: 16 additions & 7 deletions src/components/UI/Popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ export default {
}
},
watch: {
coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
},
showed(next, prev) {
if (next !== prev) {
this.open = next;
if (this.marker) {
this.marker.togglePopup();
}
}
}
},
created() {
this.popup = new this.mapbox.Popup(this.$props);
},
Expand All @@ -146,13 +162,6 @@ export default {
}
},
watch: {
coordinates(lngLat) {
if (this.initial) return;
this.popup.setLngLat(lngLat);
}
},
methods: {
$_addPopup() {
this.popup = new this.mapbox.Popup(this.$props);
Expand Down

0 comments on commit 66aac6c

Please sign in to comment.