Skip to content

Commit 028d307

Browse files
author
Ferenc Nánási
committed
CSS optimized, scroll to top button added to file browser
1 parent 1686fe3 commit 028d307

8 files changed

+61
-10
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Important Android stuff:
3737
- [CSS] Improved contrast,
3838
- Made the whole app more consistent,
3939
- Set Youtube quality on "Open URL" dialog.
40+
- Scroll to top added to File browser

src/components/addCollectionModal.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
</ion-item>
3030
<ion-item lines="full">
3131
<ion-label>Media type</ion-label>
32-
<ion-select :value="dialog.type" v-model="dialog.type">
32+
<ion-select
33+
:value="dialog.type"
34+
v-model="dialog.type"
35+
:interface-options="{ cssClass: 'alertbox' }"
36+
>
3337
<!-- // TYPE Can be: Movies - 1, TVShows - 2, Music - 3 !-->
3438
<ion-select-option :value="1"> Movies </ion-select-option>
3539
<ion-select-option :value="2"> TVShows </ion-select-option>

src/components/audioSettingsModal.vue

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
:value="activeAudioTrackId"
1818
@ionChange="onSwitchAudioClicked"
1919
v-model="selectedTrack"
20+
:interface-options="{ cssClass: 'alertbox' }"
2021
>
2122
<ion-select-option
2223
:value="audio.id"

src/components/fileBrowserModal.vue

+39-7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
<ion-content
3939
ref="browserContent"
4040
class="ion-padding"
41+
:scroll-events="true"
42+
@ionScroll="logScroll($event)"
4143
v-if="(files.cwd || files.collection_id) && connectionState"
4244
>
4345
<ion-list>
@@ -127,6 +129,18 @@
127129
</ion-item>
128130
</ion-list>
129131
</ion-content>
132+
<ion-fab
133+
v-if="scrollToTopEnabled"
134+
vertical="bottom"
135+
horizontal="end"
136+
slot="fixed"
137+
@click="onScrollToTopClicked"
138+
>
139+
<ion-fab-button>
140+
<ion-icon :icon="arrowUp"></ion-icon>
141+
</ion-fab-button>
142+
</ion-fab>
143+
130144
<ion-footer v-if="showOpenFolder">
131145
<ion-button
132146
:disabled="!files.cwd"
@@ -164,11 +178,13 @@ import {
164178
alertController,
165179
IonInfiniteScroll,
166180
IonInfiniteScrollContent,
181+
IonFab,
182+
IonFabButton,
167183
} from "@ionic/vue";
168184
import {
185+
arrowUp,
169186
folder,
170187
document,
171-
add,
172188
fileTray,
173189
bookmarksOutline,
174190
musicalNotes,
@@ -198,6 +214,9 @@ export default {
198214
const INFINITE_SCROLL_STEP = 100;
199215
const infiniteScrollEnabled = ref(false);
200216
217+
// Scroll to top
218+
const scrollToTopEnabled = ref(false);
219+
201220
const filesBak = ref([]);
202221
const collections = ref([]);
203222
const search = ref("");
@@ -206,7 +225,6 @@ export default {
206225
207226
const showOpenFolder = ref(props.action === FileBrowserActions.OPENFOLDER);
208227
const drives = ref([]);
209-
210228
const filemanLastPath = store.state.settings.filemanLastPath;
211229
const sortBy = ref(FileBrowserSortBy.NAME);
212230
@@ -516,7 +534,7 @@ export default {
516534
const onSortByClicked = async () => {
517535
const alert = await alertController.create({
518536
header: "Sort by",
519-
cssClass: "alert",
537+
cssClass: "alertbox",
520538
inputs: [
521539
{
522540
type: "radio",
@@ -563,8 +581,18 @@ export default {
563581
}
564582
};
565583
584+
const logScroll = async (event) => {
585+
if (event.detail.scrollTop > 0) scrollToTopEnabled.value = true;
586+
else scrollToTopEnabled.value = false;
587+
};
588+
589+
const onScrollToTopClicked = () => {
590+
browserContent.value.$el.scrollToPoint(0, 0, 500);
591+
};
592+
566593
loadFileBrowser();
567594
return {
595+
logScroll,
568596
onCancelClicked,
569597
onPrevDirectoryClicked,
570598
onOpenDirectoryClicked,
@@ -574,6 +602,9 @@ export default {
574602
decideIcon,
575603
onCollectionsClicked,
576604
getDirectoryContents,
605+
onSortByClicked,
606+
onInfiniteScroll,
607+
onScrollToTopClicked,
577608
browsableFiles,
578609
connectionState: computed(
579610
() => store.getters["simpleapi/connectionState"]
@@ -584,7 +615,6 @@ export default {
584615
files,
585616
folder,
586617
document,
587-
add,
588618
fileTray,
589619
bookmarksOutline,
590620
search,
@@ -595,11 +625,11 @@ export default {
595625
drives,
596626
serverConfig,
597627
funnelOutline,
598-
onSortByClicked,
599-
onInfiniteScroll,
600628
infiniteScrollEnabled,
601629
browserContent,
602630
arrowBackSharp,
631+
arrowUp,
632+
scrollToTopEnabled,
603633
};
604634
},
605635
components: {
@@ -619,6 +649,8 @@ export default {
619649
IonListHeader,
620650
IonInfiniteScroll,
621651
IonInfiniteScrollContent,
652+
IonFab,
653+
IonFabButton,
622654
},
623655
};
624656
</script>
@@ -630,7 +662,7 @@ ion-footer {
630662
}
631663
632664
ion-footer ion-button {
633-
width: 120px;
665+
min-width: 120px;
634666
}
635667
636668
.fileformatSubtitle {

src/components/openURLModal.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
</ion-item>
2828
<ion-item lines="full">
2929
<ion-label>Youtube quality</ion-label>
30-
<ion-select v-model="dialog['file-local-options']['ytdl-format']">
30+
<ion-select
31+
v-model="dialog['file-local-options']['ytdl-format']"
32+
:interface-options="{ cssClass: 'alertbox' }"
33+
>
3134
<ion-select-option value="">Default</ion-select-option>
3235
<ion-select-option value="bestvideo[height<=?2160]+bestaudio/best"
3336
>4k</ion-select-option

src/components/subtitleSettingsModal.vue

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
v-model="selectedTrack"
1818
@ionChange="onSubtitleTrackChanged"
1919
:value="activeSubTrackId"
20+
:interface-options="{ cssClass: 'alertbox' }"
2021
>
2122
<ion-select-option
2223
:value="sub.id"
@@ -56,6 +57,7 @@
5657
<ion-label>ASS Override</ion-label>
5758

5859
<ion-select
60+
:interface-options="{ cssClass: 'alertbox' }"
5961
@ionChange="onAssOverridechanged"
6062
:value="currentAssOverride"
6163
>

src/theme/variables.css

+4
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,7 @@ ion-toolbar {
157157
ion-searchbar {
158158
color: #fff !important;
159159
}
160+
161+
.alertbox .alert-wrapper button {
162+
color: #04c8c5;
163+
}

src/views/Playlist.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
fill="clear"
4848
slot="end"
4949
>
50-
<ion-icon slot="icon-only" :icon="trashBin"></ion-icon>
50+
<ion-icon
51+
style="color: white"
52+
slot="icon-only"
53+
:icon="trashBin"
54+
></ion-icon>
5155
</ion-button>
5256
<ion-reorder slot="end"></ion-reorder>
5357
</ion-item>

0 commit comments

Comments
 (0)