cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-07-16 16:17:55 +02:00
parent 74734113b0
commit 2bc3828ab5
3 changed files with 110 additions and 104 deletions

View File

@ -69,8 +69,7 @@ Vue.component('l-icon', window.Vue2Leaflet.LIcon);
Vue.component('l-popup', window.Vue2Leaflet.LPopup);
Vue.component('l-tooltip', window.Vue2Leaflet.LTooltip);
Vue.component('l-control-scale', window.Vue2Leaflet.LControlScale);
Vue.component('l-draggable', window.vuedraggable);
Vue.use(window.VueTextareaAutosize.install)
Vue.use(window.VueTextareaAutosize)
Vue.component('multiselect', window.VueMultiselect.default)
@ -88,7 +87,6 @@ const app = new Vue({
query:{hotel:[],flight:[],nominatim:[]},
querying:{hotel:false,flight:false,place:false,food:false},
impexp:"",
activities_tmp:[],
},
methods: {
start_journey: function(event){
@ -101,14 +99,20 @@ const app = new Vue({
next_step: function(){
this.journey_step+=1;
this.journey_step_data = this.step_convert(this.journey_step);
this.activities_tmp = this.journey_data.main[this.journey_step_data.section].places.activities.filter(e=>e.step==this.journey_step)
if(this.journey_step_data.section==-1) this.prev_step();
window.location.hash = '#' + this.journey_step;
},
prev_step: function(){
this.journey_step-=1;
if(this.journey_step<-1) this.journey_step=-1;
this.journey_step_data = this.step_convert(this.journey_step);
window.location.hash = '#' + this.journey_step;
},
first_step: function(){
this.journey_step=-1;
this.journey_step_data = {day:-1, section:-1};
this.activities_tmp = [];
window.location.hash = '';
},
step_convert: function(step){
@ -140,7 +144,10 @@ const app = new Vue({
}
return query_nominatim(txt,f)
.then((results) =>{
results.forEach(r=>r.latlon=[parseFloat(r.lat),parseFloat(r.lon)])
results.forEach(r=>{
r.latlon=[parseFloat(r.lat),parseFloat(r.lon)];
r.sname=r.display_name.split(',')[0];
})
this.query.nominatim=results;
});
},
@ -157,9 +164,10 @@ const app = new Vue({
});
},
generate_icon: function(item){
return L.AwesomeMarkers.icon(
{icon: icon_type(item) || 'star', prefix: 'fa',markerColor: item.color || 'blue'}
generate_icon: function(item,fcolor){
return L.AwesomeMarkers.icon({
icon: icon_type(item) || 'star', prefix: 'fa',
markerColor: fcolor || item.color || 'blue'}
).createIcon().outerHTML
},
@ -199,7 +207,6 @@ const app = new Vue({
}
}
this.journey_step_data = this.step_convert(this.journey_step);
this.activities_tmp = this.journey_data.main[this.journey_step_data.section].places.activities.filter(e=>e.step==this.journey_step);
});
this.debounceSave = _.debounce(this.save_data, 500)
this.debounceSearch = {"hotel":_.debounce((q)=>{this.querying.hotel=true;this.search_nominatim(q,(r)=>(r.type=="hotel")).then((r)=>{this.querying.hotel=false});}, 500),
@ -225,11 +232,5 @@ const app = new Vue({
},
deep: true,
},
activities_tmp:{
handler:function (nd,od){
nd.forEach(e=>e.step=this.journey_step);
},
deep: false,
},
},
})