forked from rc/aircox
radiocampus/assets/ASoundListEditor.vue: enable removing episode sounds
This commit is contained in:
parent
ff9cfd4a89
commit
b1c56173c7
|
@ -24,7 +24,9 @@
|
||||||
<a-form-set ref="formset" :form-data="formData" :labels="labels"
|
<a-form-set ref="formset" :form-data="formData" :labels="labels"
|
||||||
:initials="initData.items"
|
:initials="initData.items"
|
||||||
order-by="position"
|
order-by="position"
|
||||||
:action-add="actionAdd">
|
:action-add="actionAdd"
|
||||||
|
:action-remove="actionRemove"
|
||||||
|
>
|
||||||
<template v-for="[name,slot] of rowsSlots" :key="slot"
|
<template v-for="[name,slot] of rowsSlots" :key="slot"
|
||||||
v-slot:[slot]="data">
|
v-slot:[slot]="data">
|
||||||
<slot v-if="name != 'row-tail'" :name="name" v-bind="data"/>
|
<slot v-if="name != 'row-tail'" :name="name" v-bind="data"/>
|
||||||
|
@ -34,6 +36,7 @@
|
||||||
<label>{{ item.data.name }}</label><br>
|
<label>{{ item.data.name }}</label><br>
|
||||||
<audio controls :src="item.data.url"/>
|
<audio controls :src="item.data.url"/>
|
||||||
<input type="hidden" :name="inputName" :value="item.data.sound"/>
|
<input type="hidden" :name="inputName" :value="item.data.sound"/>
|
||||||
|
<input type="checkbox" :name="item.data.delete_attr_name" :id="item.data.delete_attr_name" style="display:none;">
|
||||||
</template>
|
</template>
|
||||||
</a-form-set>
|
</a-form-set>
|
||||||
</div>
|
</div>
|
||||||
|
@ -78,6 +81,12 @@ export default {
|
||||||
}
|
}
|
||||||
this.$refs.formset.set.push(data)
|
this.$refs.formset.set.push(data)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
actionRemove(row, item) {
|
||||||
|
var ckbox = document.getElementById(item.data.delete_attr_name);
|
||||||
|
ckbox.checked = true;
|
||||||
|
ckbox.parentNode.parentNode.style["display"] = "none";
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user