1
1
<template >
2
2
<b-container
3
3
id =" root"
4
- class =" d-flex flex-column vh-100 "
4
+ class =" d-flex flex-column"
5
5
>
6
6
<track-manager-nav-bar :sid =" sid" />
7
7
<div
43
43
>
44
44
All
45
45
</b-button >
46
- <b-button
47
- class =" m-2 button-year-navbar"
48
- variant =" outline-primary"
49
- @click =" setLayout(currentOrientation === 'portrait' ? 'landscape' : 'portrait')"
50
- >
51
- Orientation
52
- </b-button >
53
46
</div >
54
47
<div
55
48
ref =" outerSplitFrame"
56
- class =" split flex-grow-1 d-flex minheight-0"
57
- :class =" [flexBoxFlowClass]"
49
+ class =" flex-grow-1 flex-column d-flex"
58
50
>
59
51
<div
60
- id =" leftpanel"
61
- class =" overflow-auto minheight-0"
62
- >
63
- <filtered-track-list />
64
- </div >
65
-
66
- <div
67
- id =" rightpanel"
68
- class =" d-flex"
52
+ class =" d-flex p-2"
53
+ style =" height : 40vh ;"
69
54
>
70
55
<filtered-map :sid =" sid" />
71
56
</div >
57
+ <filtered-track-list />
72
58
</div >
73
59
</b-container >
74
60
</template >
@@ -81,16 +67,8 @@ import FilteredMap from '@/components/FilteredMap.vue'
81
67
import { TrackCollection } from ' @/lib/Track'
82
68
import { getTracksByYear , getAllTracks } from ' @/lib/trackServices.js'
83
69
import { mapActions , mapState , mapMutations } from ' vuex'
84
- import Split from ' split.js'
85
70
const _ = require (' lodash' )
86
71
87
- function getViewPortOrientation () {
88
- const mediaQueryString = ' (orientation: portrait)'
89
- const mqList = window .matchMedia (mediaQueryString)
90
- const orientation = mqList .matches ? ' portrait' : ' landscape'
91
- return orientation
92
- }
93
-
94
72
export default {
95
73
name: ' SelectTracksPage' ,
96
74
components: {
@@ -109,7 +87,6 @@ export default {
109
87
},
110
88
data : function () {
111
89
return {
112
- currentOrientation: ' landscape' ,
113
90
resizeObserver: null ,
114
91
years: [],
115
92
buttonsLoading: false ,
@@ -119,17 +96,10 @@ export default {
119
96
computed: {
120
97
... mapState ([
121
98
' loadedTracks'
122
- ]),
123
- flexBoxFlowClass () {
124
- return this .currentOrientation === ' portrait' ? ' flex-column' : ' flex-row'
125
- },
126
- splitDirectionOption () {
127
- return this .currentOrientation === ' portrait' ? ' vertical' : ' horizontal'
128
- }
129
-
99
+ ])
130
100
},
131
101
async created () {
132
- this .currentOrientation = getViewPortOrientation ()
102
+ this .currentOrientation = ' landscape '
133
103
this .buttonsLoading = true
134
104
await this .getYears ()
135
105
this .buttonsLoading = false
@@ -144,10 +114,6 @@ export default {
144
114
// split should definitely run before the map is attached to the div
145
115
// so when map is run through nextTick - then let's not run split in nexttick - otherwise
146
116
// it runs to early and map is not correctly rendered
147
- this .split = Split ([' #leftpanel' , ' #rightpanel' ], {
148
- onDragEnd: this .resizeMapFlag ,
149
- direction: this .splitDirectionOption
150
- })
151
117
// observe if window aspect is changing, then call setLayout
152
118
const debouncedOnResize = _ .debounce (
153
119
this .onResize ,
@@ -183,55 +149,15 @@ export default {
183
149
const loadFunc = () => getAllTracks (sid)
184
150
this .loadTracksAndRedraw (loadFunc).catch (e => console .error (' Error loading all tracks' , e))
185
151
},
186
- setLayout (wantedOrientation ) {
187
- if (wantedOrientation === this .currentOrientation ) {
188
- return
189
- }
190
- // destroy the managed split
191
- this .split .destroy ()
192
- // change flex layout
193
- this .currentOrientation = wantedOrientation
194
- // create new split
195
- this .split = Split ([' #leftpanel' , ' #rightpanel' ], {
196
- onDragEnd: this .resizeMapFlag ,
197
- direction: this .splitDirectionOption
198
- })
199
- // resize map
200
- this .resizeMapFlag ()
201
- },
202
152
onResize () {
203
153
console .log (' resize1' )
204
- this .setLayout ( getViewPortOrientation () )
154
+ this .resizeMapFlag ( )
205
155
}
206
156
}
207
157
}
208
158
</script >
209
- <style scoped>
210
-
211
- /* Needed for vertical overflow: scroll in flexbox container */
212
- .minheight-0 {
213
- min-height : 0 ;
214
- }
215
- </style >
216
159
<style >
217
160
218
- /* Split.js css entries can not reside in scoped style section */
219
- .gutter {
220
- background-color : rgb (255 , 255 , 255 );
221
- background-repeat : no-repeat ;
222
- background-position : 50% ;
223
- }
224
-
225
- .gutter.gutter-horizontal {
226
- background-image : url (' data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==' );
227
- cursor : col-resize ;
228
- }
229
-
230
- .gutter.gutter-vertical {
231
- background-image : url (' data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=' );
232
- cursor : row-resize ;
233
- }
234
-
235
161
.button-year-navbar {
236
162
height : max-content ;
237
163
white-space : nowrap ;
0 commit comments