Open Sidebar

This commit is contained in:
portree_kid 2020-05-21 18:16:03 +02:00
parent 26726df251
commit f3703d1ef8

View File

@ -6,8 +6,8 @@
<li><a href="#home" role="tab"><i class="fa fa-bars"></i></a></li> <li><a href="#home" role="tab"><i class="fa fa-bars"></i></a></li>
<li><a href="#edit" role="tab"><i class="fas fa-edit"></i></a></li> <li><a href="#edit" role="tab"><i class="fas fa-edit"></i></a></li>
<li><a href="#parking" role="tab"><i class="fas fa-parking"></i></a></li> <li><a href="#parking" role="tab"><i class="fas fa-parking"></i></a></li>
<li><a href="#search" role="tab"><i class="fa fa-search"></i></a></li>
<li><a href="#check" role="tab"><i class="far fa-check-square"></i></a></li> <li><a href="#check" role="tab"><i class="far fa-check-square"></i></a></li>
<li><a href="#search" role="tab"><i class="fa fa-search"></i></a></li>
<li><a href="#wip" role="tab"><i class="fas fa-wrench"></i></a></li> <li><a href="#wip" role="tab"><i class="fas fa-wrench"></i></a></li>
</ul> </ul>
@ -88,11 +88,27 @@
deferredMountedTo (parent) { deferredMountedTo (parent) {
this.sidebar = L.control.sidebar({ this.sidebar = L.control.sidebar({
autopan: false, // whether to maintain the centered map point when opening the sidebar autopan: false, // whether to maintain the centered map point when opening the sidebar
closeButton: true, // whether t add a close button to the panes closeButton: true, // whether to add a close button to the panes
container: 'sidebar', // the DOM container or #ID of a predefined sidebar container that should be used container: 'sidebar', // the DOM container or #ID of a predefined sidebar container that should be used
position: 'left' // left or right position: 'left' // left or right
}) })
parent.addControl(this.sidebar) parent.addControl(this.sidebar)
this.$store.subscribe((mutation, state) => {
switch (mutation.type) {
case 'SET_EDIT_AIRPORT':
case 'SET_EDIT_PARKING':
case 'SET_EDIT_NODE':
case 'SET_EDIT_RUNWAY':
case 'SET_EDIT_ARC':
this.sidebar.open('edit')
break
case 'CHECK_RESULTS':
this.sidebar.open('check')
break
default:
break
}
})
}, },
remove () { remove () {
if (this.sidebar) { if (this.sidebar) {