mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
implement clearing search input on start typing
+ rename pages folder to fetch in composables folder
This commit is contained in:
+4
-2
@@ -46,7 +46,7 @@ const app_dom = document.getElementById("app");
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// function to add the
|
// function to add the
|
||||||
|
|
||||||
queue.readQueue();
|
queue.readQueue();
|
||||||
useShortcuts(useQStore);
|
useShortcuts(useQStore);
|
||||||
@@ -73,7 +73,9 @@ router.afterEach((to, from) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onStartTyping(() => {
|
onStartTyping(() => {
|
||||||
document.getElementById("globalsearch").focus();
|
const elem = document.getElementById("globalsearch") as HTMLInputElement;
|
||||||
|
elem.focus();
|
||||||
|
elem.value = "";
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { createNewPlaylist } from "../../composables/pages/playlists";
|
import { createNewPlaylist } from "../../composables/fetch/playlists";
|
||||||
import { Track } from "../../interfaces";
|
import { Track } from "../../interfaces";
|
||||||
import { Notification, NotifType } from "../../stores/notification";
|
import { Notification, NotifType } from "../../stores/notification";
|
||||||
import usePlaylistStore from "@/stores/pages/playlists";
|
import usePlaylistStore from "@/stores/pages/playlists";
|
||||||
|
|||||||
@@ -55,8 +55,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import usePStore from "@/stores/pages/playlist";
|
import usePStore from "@/stores/pages/playlist";
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { updatePlaylist } from "../../composables/pages/playlists";
|
import { updatePlaylist } from "@/composables/fetch/playlists";
|
||||||
import { Playlist } from "../../interfaces";
|
import { Playlist } from "@/interfaces";
|
||||||
|
|
||||||
const pStore = usePStore();
|
const pStore = usePStore();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Artist } from "./../../interfaces";
|
import { Artist } from "../../interfaces";
|
||||||
import { Playlist, Track } from "../../interfaces";
|
import { Playlist, Track } from "../../interfaces";
|
||||||
import { Notification, NotifType } from "../../stores/notification";
|
import { Notification, NotifType } from "../../stores/notification";
|
||||||
import state from "../state";
|
import state from "../state";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import state from "./state";
|
import state from "../state";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const base_url = `${state.settings.uri}/search`;
|
const base_url = `${state.settings.uri}/search`;
|
||||||
@@ -3,7 +3,7 @@ import useQStore from "@/stores/queue";
|
|||||||
let key_down_fired = false;
|
let key_down_fired = false;
|
||||||
|
|
||||||
function focusSearchBox() {
|
function focusSearchBox() {
|
||||||
const elem = document.getElementById("search");
|
const elem = document.getElementById("globalsearch");
|
||||||
|
|
||||||
elem.focus();
|
elem.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Option } from "../interfaces";
|
|||||||
import {
|
import {
|
||||||
getAllPlaylists,
|
getAllPlaylists,
|
||||||
addTrackToPlaylist,
|
addTrackToPlaylist,
|
||||||
} from "../composables/pages/playlists";
|
} from "../composables/fetch/playlists";
|
||||||
|
|
||||||
import useQueueStore from "../stores/queue";
|
import useQueueStore from "../stores/queue";
|
||||||
import useModalStore from "../stores/modal";
|
import useModalStore from "../stores/modal";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
getAlbumTracks,
|
getAlbumTracks,
|
||||||
getAlbumArtists,
|
getAlbumArtists,
|
||||||
getAlbumBio,
|
getAlbumBio,
|
||||||
} from "../../composables/pages/album";
|
} from "../../composables/fetch/album";
|
||||||
|
|
||||||
function sortTracks(tracks: Track[]) {
|
function sortTracks(tracks: Track[]) {
|
||||||
return tracks.sort((a, b) => {
|
return tracks.sort((a, b) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Folder, Track } from "../../interfaces";
|
import { Folder, Track } from "../../interfaces";
|
||||||
|
|
||||||
import fetchThem from "../../composables/pages/folders";
|
import fetchThem from "../../composables/fetch/folders";
|
||||||
|
|
||||||
export default defineStore("FolderDirs&Tracks", {
|
export default defineStore("FolderDirs&Tracks", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { defineStore } from "pinia";
|
|||||||
import {
|
import {
|
||||||
getPlaylist,
|
getPlaylist,
|
||||||
getPlaylistArtists,
|
getPlaylistArtists,
|
||||||
} from "../../composables/pages/playlists";
|
} from "../../composables/fetch/playlists";
|
||||||
import { Track, Playlist } from "../../interfaces";
|
import { Track, Playlist } from "../../interfaces";
|
||||||
|
|
||||||
export default defineStore("playlist-tracks", {
|
export default defineStore("playlist-tracks", {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Playlist } from "../../interfaces";
|
import { Playlist } from "../../interfaces";
|
||||||
import { getAllPlaylists } from "../../composables/pages/playlists";
|
import { getAllPlaylists } from "../../composables/fetch/playlists";
|
||||||
|
|
||||||
export default defineStore("playlists", {
|
export default defineStore("playlists", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
loadMoreTracks,
|
loadMoreTracks,
|
||||||
loadMoreAlbums,
|
loadMoreAlbums,
|
||||||
loadMoreArtists,
|
loadMoreArtists,
|
||||||
} from "../composables/searchMusic";
|
} from "../composables/fetch/searchMusic";
|
||||||
import { watch } from "vue";
|
import { watch } from "vue";
|
||||||
import useDebouncedRef from "../composables/useDebouncedRef";
|
import useDebouncedRef from "../composables/useDebouncedRef";
|
||||||
import useTabStore from "./tabs";
|
import useTabStore from "./tabs";
|
||||||
|
|||||||
Reference in New Issue
Block a user