player
This commit is contained in:
parent
202f31d169
commit
6b7cfbdadf
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -59,7 +59,7 @@
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
{% if object.episodesound_set.available.public.count %}
|
{% if object.episodesound_set.available.public.count %}
|
||||||
<button class="button action" @click="player.playButtonClick($event)"
|
<button type="button" class="button action" @click="player.playButtonClick($event)"
|
||||||
data-sounds="{{ object.podcasts|json }}">
|
data-sounds="{{ object.podcasts|json }}">
|
||||||
<span class="icon is-small">
|
<span class="icon is-small">
|
||||||
<span class="fas fa-play"></span>
|
<span class="fas fa-play"></span>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
emits: ['select', 'unselect', 'move'],
|
emits: ['select', 'unselect', 'move', 'remove'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedIndex: this.defaultIndex,
|
selectedIndex: this.defaultIndex,
|
||||||
|
@ -50,11 +50,16 @@ export default {
|
||||||
findIndex(pred) { return this.set.findIndex(pred) },
|
findIndex(pred) { return this.set.findIndex(pred) },
|
||||||
|
|
||||||
remove(index, select=false) {
|
remove(index, select=false) {
|
||||||
|
const item = this.set.get(index)
|
||||||
|
if(!item)
|
||||||
|
return
|
||||||
|
|
||||||
this.set.remove(index);
|
this.set.remove(index);
|
||||||
if(index < this.selectedIndex)
|
if(index < this.selectedIndex)
|
||||||
this.selectedIndex--;
|
this.selectedIndex--;
|
||||||
if(select && this.selectedIndex == index)
|
if(select && this.selectedIndex == index)
|
||||||
this.select(index)
|
this.select(index)
|
||||||
|
this.$emit('remove', {index, item, set: this.set})
|
||||||
},
|
},
|
||||||
|
|
||||||
select(index) {
|
select(index) {
|
||||||
|
|
|
@ -274,7 +274,6 @@ export default {
|
||||||
if(event.type == 'ended' && (!this.playlist || this.playlist.selectNext() == -1))
|
if(event.type == 'ended' && (!this.playlist || this.playlist.selectNext() == -1))
|
||||||
this.play();
|
this.play();
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import ASoundItem from './ASoundItem';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extends: AList,
|
extends: AList,
|
||||||
emits: [...AList.emits, 'remove'],
|
emits: [...AList.emits],
|
||||||
components: { ASoundItem },
|
components: { ASoundItem },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user