Implemented vue-observe-visibility
This commit is contained in:
parent
557081482e
commit
1d30107c59
6 changed files with 72 additions and 48 deletions
|
@ -1,10 +1,12 @@
|
|||
Vue.use(VueObserveVisibility);
|
||||
|
||||
|
||||
Vue.component('sidebar-library-item', {
|
||||
template: '#sidebar-library-item',
|
||||
props: ['name', 'page', 'cd-click'],
|
||||
methods: {}
|
||||
});
|
||||
|
||||
|
||||
Vue.component('lyrics-view', {
|
||||
template: '#lyrics-view',
|
||||
props: ["time", "lyrics", "translation"],
|
||||
|
@ -83,7 +85,7 @@ const app = new Vue({
|
|||
"albumName": "Album",
|
||||
"artistName": "Artist",
|
||||
"name": "Name",
|
||||
"genreNames": "Genre",
|
||||
"genre": "Genre",
|
||||
"releaseDate": "Release Date",
|
||||
"durationInMillis": "Duration"
|
||||
},
|
||||
|
@ -384,14 +386,12 @@ const app = new Vue({
|
|||
// sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending order based on alphabetical order and numeric order
|
||||
// check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case
|
||||
self.library.songs.displayListing.sort((a, b) => {
|
||||
let aa = null;
|
||||
let bb = null;
|
||||
if(self.library.songs.sorting == "genreNames") {
|
||||
if(self.library.songs.sorting == "genre") {
|
||||
aa = a.attributes.genreNames[0]
|
||||
bb = b.attributes.genreNames[0]
|
||||
}
|
||||
aa = a.attributes[self.library.songs.sorting]
|
||||
bb = b.attributes[self.library.songs.sorting]
|
||||
let aa = a.attributes[self.library.songs.sorting]
|
||||
let bb = b.attributes[self.library.songs.sorting]
|
||||
if (aa == null) {
|
||||
aa = ""
|
||||
}
|
||||
|
@ -1074,7 +1074,7 @@ const app = new Vue({
|
|||
}
|
||||
|
||||
if (xmlHttp.status === 200) {
|
||||
console.log('SUCCESS', xmlHttp.responseText);
|
||||
// console.log('SUCCESS', xmlHttp.responseText);
|
||||
callback(JSON.parse(xmlHttp.responseText));
|
||||
} else {
|
||||
console.warn('request_error');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue