Merge pull request #472 from gfrenoy/master
Support for arrow keys when display medias
This commit is contained in:
commit
3211c79c39
|
@ -6,9 +6,9 @@
|
||||||
<el-button type="text" icon="el-icon-close" @click="close" class="close-button"></el-button>
|
<el-button type="text" icon="el-icon-close" @click="close" class="close-button"></el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="image-content">
|
<div class="image-content">
|
||||||
<span class="button-area"><el-button type="text" v-show="showLeft"><i class="el-icon-arrow-left" @click.stop="decrementIndex"></i></el-button></span>
|
<span class="button-area"><el-button type="text" v-show="showLeft" v-shortkey="['arrowleft']" @shortkey.native="decrementIndex()"><i class="el-icon-arrow-left" @click.stop="decrementIndex"></i></el-button></span>
|
||||||
<Media :src="imageURL"></Media>
|
<Media :src="imageURL"></Media>
|
||||||
<span class="button-area"><el-button type="text" v-show="showRight"><i class="el-icon-arrow-right" @click.stop="incrementIndex"></i></el-button></span>
|
<span class="button-area"><el-button type="text" v-show="showRight" v-shortkey="['arrowright']" @shortkey.native="incrementIndex()"><i class="el-icon-arrow-right" @click.stop="incrementIndex"></i></el-button></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,10 +48,10 @@ export default {
|
||||||
this.$store.dispatch('TimelineSpace/Modals/ImageViewer/closeModal')
|
this.$store.dispatch('TimelineSpace/Modals/ImageViewer/closeModal')
|
||||||
},
|
},
|
||||||
decrementIndex () {
|
decrementIndex () {
|
||||||
this.$store.dispatch('TimelineSpace/Modals/ImageViewer/decrementIndex')
|
if (this.showLeft) this.$store.dispatch('TimelineSpace/Modals/ImageViewer/decrementIndex')
|
||||||
},
|
},
|
||||||
incrementIndex () {
|
incrementIndex () {
|
||||||
this.$store.dispatch('TimelineSpace/Modals/ImageViewer/incrementIndex')
|
if (this.showRight) this.$store.dispatch('TimelineSpace/Modals/ImageViewer/incrementIndex')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue