Add download icon in image slideshow

This commit is contained in:
Frederic Guillot
2016-12-11 19:44:29 -05:00
parent a3d1ce47d3
commit ed406b7997
6 changed files with 18 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -20,6 +20,8 @@ KB.component('image-slideshow', function (containerElement, options) {
renderNextSlide();
} else if (element.matches('.slideshow-previous-icon')) {
renderPreviousSlide();
} else if (element.matches('.slideshow-download-icon')) {
window.location.href = element.href;
} else {
destroySlide();
}
@@ -75,6 +77,11 @@ KB.component('image-slideshow', function (containerElement, options) {
.attr('class', 'fa fa-window-close slideshow-icon slideshow-close-icon')
.build();
var downloadElement = KB.dom('a')
.attr('class', 'fa fa-download slideshow-icon slideshow-download-icon')
.attr('href', getUrl(currentImage, 'download'))
.build();
var previousElement = KB.dom('div')
.attr('class', 'fa fa-chevron-circle-left slideshow-icon slideshow-previous-icon')
.build();
@@ -102,6 +109,7 @@ KB.component('image-slideshow', function (containerElement, options) {
var overlayElement = KB.dom('div')
.addClass('image-slideshow-overlay')
.add(closeElement)
.add(downloadElement)
.add(previousElement)
.add(nextElement)
.add(figureElement)

View File

@@ -38,3 +38,8 @@
right: 10px
top: 10px
font-size: 1.4em
.slideshow-download-icon
left: 10px
bottom: 10px
font-size: 1.3em