Skip to content

Commit

Permalink
Merge pull request #372 from IshavSohal/issue-323-fix
Browse files Browse the repository at this point in the history
Disable dragging feature of slide toc
  • Loading branch information
yileifeng authored Aug 29, 2024
2 parents 4ae4c85 + 6fab590 commit 00e9ce1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/slide-toc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</vue-final-modal>
</div>
<ul class="max-h-screen overflow-y-auto">
<draggable v-model="slides" @update="$emit('slides-updated', slides)" item-key="title" v-focus-list>
<draggable :list="slides" @update="$emit('slides-updated', slides)" :item-key="getSlideId" v-focus-list>
<template #item="{ element, index }">
<li
class="toc-slide border-t flex px-2 cursor-pointer hover:bg-gray-300"
Expand Down Expand Up @@ -324,6 +324,10 @@ export default class SlideTocV extends Vue {
this.slides.splice(index + 1, 0, this.slides.splice(index, 1)[0]);
this.$emit('slides-updated', this.slides);
}
getSlideId(slide: Slide): string {
return slide.title + this.slides.indexOf(slide);
}
}
</script>

Expand Down

0 comments on commit 00e9ce1

Please sign in to comment.