summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-12-11 19:44:29 -0500
committerFrederic Guillot <fred@kanboard.net>2016-12-11 19:44:29 -0500
commited406b7997f11c630aed336f0480f65862e47eb9 (patch)
tree778d9b5bd6f715530c1981deb724a77c1402d275 /assets/js/components
parenta3d1ce47d3bf31bfc5bea06f76abdfb404c5f2fc (diff)
Add download icon in image slideshow
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/image-slideshow.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/assets/js/components/image-slideshow.js b/assets/js/components/image-slideshow.js
index bf41de93..9d3fb0ad 100644
--- a/assets/js/components/image-slideshow.js
+++ b/assets/js/components/image-slideshow.js
@@ -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)