Skip to content
Snippets Groups Projects
Commit 27d54ee9 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'playlist-perfs' into 'develop'

Use smaller images when possible to increase performance on client-side

See merge request funkwhale/funkwhale!328
parents ba5c3bfc 979c554b
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
</div> </div>
<template v-if="album"> <template v-if="album">
<div :class="['ui', 'head', {'with-background': album.cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle" v-title="album.title"> <div :class="['ui', 'head', {'with-background': album.cover.original}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle" v-title="album.title">
<div class="segment-content"> <div class="segment-content">
<h2 class="ui center aligned icon header"> <h2 class="ui center aligned icon header">
<i class="circular inverted sound yellow icon"></i> <i class="circular inverted sound yellow icon"></i>
...@@ -98,10 +98,10 @@ export default { ...@@ -98,10 +98,10 @@ export default {
return 'https://musicbrainz.org/release/' + this.album.mbid return 'https://musicbrainz.org/release/' + this.album.mbid
}, },
headerStyle () { headerStyle () {
if (!this.album.cover) { if (!this.album.cover.original) {
return '' return ''
} }
return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.album.cover) + ')' return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.album.cover.original) + ')'
} }
}, },
watch: { watch: {
......
...@@ -158,10 +158,10 @@ export default { ...@@ -158,10 +158,10 @@ export default {
})[0] })[0]
}, },
headerStyle () { headerStyle () {
if (!this.cover) { if (!this.cover.original) {
return '' return ''
} }
return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.cover) + ')' return 'background-image: url(' + this.$store.getters['instance/absoluteUrl'](this.cover.original) + ')'
} }
}, },
watch: { watch: {
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
<h3 class="ui header"> <h3 class="ui header">
<slot name="title"></slot> <slot name="title"></slot>
</h3> </h3>
<i @click="fetchData(previousPage)" :disabled="!previousPage" :class="['ui', {disabled: !previousPage}, 'circular', 'large', 'angle up', 'icon']"> <i @click="fetchData(previousPage)" :disabled="!previousPage" :class="['ui', {disabled: !previousPage}, 'circular', 'medium', 'angle up', 'icon']">
</i> </i>
<i @click="fetchData(nextPage)" :disabled="!nextPage" :class="['ui', {disabled: !nextPage}, 'circular', 'large', 'angle down', 'icon']"> <i @click="fetchData(nextPage)" :disabled="!nextPage" :class="['ui', {disabled: !nextPage}, 'circular', 'medium', 'angle down', 'icon']">
</i>
<i @click="fetchData(url)" :class="['ui', 'circular', 'medium', 'refresh', 'icon']">
</i> </i>
<div v-if="isLoading" class="ui inverted active dimmer"> <div v-if="isLoading" class="ui inverted active dimmer">
<div class="ui loader"></div> <div class="ui loader"></div>
...@@ -75,3 +77,8 @@ export default { ...@@ -75,3 +77,8 @@ export default {
} }
} }
</script> </script>
<style scoped>
.refresh.icon {
float: right;
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment