player
This commit is contained in:
		
										
											
												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.super }}
 | 
			
		||||
{% 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 }}">
 | 
			
		||||
    <span class="icon is-small">
 | 
			
		||||
        <span class="fas fa-play"></span>
 | 
			
		||||
 | 
			
		||||
@ -16,7 +16,7 @@
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
    emits: ['select', 'unselect', 'move'],
 | 
			
		||||
    emits: ['select', 'unselect', 'move', 'remove'],
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            selectedIndex: this.defaultIndex,
 | 
			
		||||
@ -50,11 +50,16 @@ export default {
 | 
			
		||||
        findIndex(pred) { return this.set.findIndex(pred) },
 | 
			
		||||
 | 
			
		||||
        remove(index, select=false) {
 | 
			
		||||
            const item = this.set.get(index)
 | 
			
		||||
            if(!item)
 | 
			
		||||
                return
 | 
			
		||||
 | 
			
		||||
            this.set.remove(index);
 | 
			
		||||
            if(index < this.selectedIndex)
 | 
			
		||||
                this.selectedIndex--;
 | 
			
		||||
            if(select && this.selectedIndex == index)
 | 
			
		||||
                this.select(index)
 | 
			
		||||
            this.$emit('remove', {index, item, set: this.set})
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        select(index) {
 | 
			
		||||
 | 
			
		||||
@ -274,7 +274,6 @@ export default {
 | 
			
		||||
            if(event.type == 'ended' && (!this.playlist || this.playlist.selectNext() == -1))
 | 
			
		||||
                this.play();
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    mounted() {
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ import ASoundItem from './ASoundItem';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    extends: AList,
 | 
			
		||||
    emits: [...AList.emits, 'remove'],
 | 
			
		||||
    emits: [...AList.emits],
 | 
			
		||||
    components: { ASoundItem },
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user