Skip to content

Commit 59e9fbc

Browse files
authored
Merge pull request #72 from bonham/bonham/issue69
Remove resizable split view and fixed height container on select page
2 parents 0b4c55b + 1d77fbe commit 59e9fbc

File tree

4 files changed

+8
-171
lines changed

4 files changed

+8
-171
lines changed

client/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"ol": "^6.14.1",
2020
"popper.js": "^1.16.1",
2121
"portal-vue": "^2.1.7",
22-
"split.js": "^1.6.5",
2322
"sprintf-js": "^1.1.2",
2423
"vue": "^2.6.14",
2524
"vue-router": "3",

client/src/views/SelectTracksPage.vue

+8-82
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<b-container
33
id="root"
4-
class="d-flex flex-column vh-100"
4+
class="d-flex flex-column"
55
>
66
<track-manager-nav-bar :sid="sid" />
77
<div
@@ -43,32 +43,18 @@
4343
>
4444
All
4545
</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>
5346
</div>
5447
<div
5548
ref="outerSplitFrame"
56-
class="split flex-grow-1 d-flex minheight-0"
57-
:class="[flexBoxFlowClass]"
49+
class="flex-grow-1 flex-column d-flex"
5850
>
5951
<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;"
6954
>
7055
<filtered-map :sid="sid" />
7156
</div>
57+
<filtered-track-list />
7258
</div>
7359
</b-container>
7460
</template>
@@ -81,16 +67,8 @@ import FilteredMap from '@/components/FilteredMap.vue'
8167
import { TrackCollection } from '@/lib/Track'
8268
import { getTracksByYear, getAllTracks } from '@/lib/trackServices.js'
8369
import { mapActions, mapState, mapMutations } from 'vuex'
84-
import Split from 'split.js'
8570
const _ = require('lodash')
8671
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-
9472
export default {
9573
name: 'SelectTracksPage',
9674
components: {
@@ -109,7 +87,6 @@ export default {
10987
},
11088
data: function () {
11189
return {
112-
currentOrientation: 'landscape',
11390
resizeObserver: null,
11491
years: [],
11592
buttonsLoading: false,
@@ -119,17 +96,10 @@ export default {
11996
computed: {
12097
...mapState([
12198
'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+
])
130100
},
131101
async created () {
132-
this.currentOrientation = getViewPortOrientation()
102+
this.currentOrientation = 'landscape'
133103
this.buttonsLoading = true
134104
await this.getYears()
135105
this.buttonsLoading = false
@@ -144,10 +114,6 @@ export default {
144114
// split should definitely run before the map is attached to the div
145115
// so when map is run through nextTick - then let's not run split in nexttick - otherwise
146116
// 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-
})
151117
// observe if window aspect is changing, then call setLayout
152118
const debouncedOnResize = _.debounce(
153119
this.onResize,
@@ -183,55 +149,15 @@ export default {
183149
const loadFunc = () => getAllTracks(sid)
184150
this.loadTracksAndRedraw(loadFunc).catch(e => console.error('Error loading all tracks', e))
185151
},
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-
},
202152
onResize () {
203153
console.log('resize1')
204-
this.setLayout(getViewPortOrientation())
154+
this.resizeMapFlag()
205155
}
206156
}
207157
}
208158
</script>
209-
<style scoped>
210-
211-
/* Needed for vertical overflow: scroll in flexbox container */
212-
.minheight-0 {
213-
min-height: 0;
214-
}
215-
</style>
216159
<style>
217160
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-
235161
.button-year-navbar {
236162
height: max-content;
237163
white-space: nowrap;

client/tests/unit/selectTracks.spec.js

-80
This file was deleted.

client/yarn.lock

-8
Original file line numberDiff line numberDiff line change
@@ -11797,13 +11797,6 @@ __metadata:
1179711797
languageName: node
1179811798
linkType: hard
1179911799

11800-
"split.js@npm:^1.6.5":
11801-
version: 1.6.5
11802-
resolution: "split.js@npm:1.6.5"
11803-
checksum: a3e77d8e0628de06c58e2d8e6ab41872132586c417b4f40ac3d3dbf76c2b31f40745dd86c133609dacd5599ada5d4bee157f6290403223b86bd79fe700a77983
11804-
languageName: node
11805-
linkType: hard
11806-
1180711800
"sprintf-js@npm:^1.1.2":
1180811801
version: 1.1.2
1180911802
resolution: "sprintf-js@npm:1.1.2"
@@ -12474,7 +12467,6 @@ __metadata:
1247412467
portal-vue: ^2.1.7
1247512468
sass: ^1.51.0
1247612469
sass-loader: ^12.6.0
12477-
split.js: ^1.6.5
1247812470
sprintf-js: ^1.1.2
1247912471
vue: ^2.6.14
1248012472
vue-cli-plugin-bootstrap-vue: ^0.8.2

0 commit comments

Comments
 (0)