Add download icon in image slideshow
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
'url' => array(
|
'url' => array(
|
||||||
'image' => $this->url->to('FileViewerController', 'image', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])),
|
'image' => $this->url->to('FileViewerController', 'image', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])),
|
||||||
'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])),
|
'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])),
|
||||||
|
'download' => $this->url->to('FileViewerController', 'download', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])),
|
||||||
)
|
)
|
||||||
)) ?>
|
)) ?>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
'url' => array(
|
'url' => array(
|
||||||
'image' => $this->url->to('FileViewerController', 'image', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
'image' => $this->url->to('FileViewerController', 'image', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
||||||
'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
||||||
|
'download' => $this->url->to('FileViewerController', 'download', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])),
|
||||||
)
|
)
|
||||||
)) ?>
|
)) ?>
|
||||||
|
|
||||||
|
|||||||
2
assets/css/app.min.css
vendored
2
assets/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
4
assets/js/app.min.js
vendored
4
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -20,6 +20,8 @@ KB.component('image-slideshow', function (containerElement, options) {
|
|||||||
renderNextSlide();
|
renderNextSlide();
|
||||||
} else if (element.matches('.slideshow-previous-icon')) {
|
} else if (element.matches('.slideshow-previous-icon')) {
|
||||||
renderPreviousSlide();
|
renderPreviousSlide();
|
||||||
|
} else if (element.matches('.slideshow-download-icon')) {
|
||||||
|
window.location.href = element.href;
|
||||||
} else {
|
} else {
|
||||||
destroySlide();
|
destroySlide();
|
||||||
}
|
}
|
||||||
@@ -75,6 +77,11 @@ KB.component('image-slideshow', function (containerElement, options) {
|
|||||||
.attr('class', 'fa fa-window-close slideshow-icon slideshow-close-icon')
|
.attr('class', 'fa fa-window-close slideshow-icon slideshow-close-icon')
|
||||||
.build();
|
.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')
|
var previousElement = KB.dom('div')
|
||||||
.attr('class', 'fa fa-chevron-circle-left slideshow-icon slideshow-previous-icon')
|
.attr('class', 'fa fa-chevron-circle-left slideshow-icon slideshow-previous-icon')
|
||||||
.build();
|
.build();
|
||||||
@@ -102,6 +109,7 @@ KB.component('image-slideshow', function (containerElement, options) {
|
|||||||
var overlayElement = KB.dom('div')
|
var overlayElement = KB.dom('div')
|
||||||
.addClass('image-slideshow-overlay')
|
.addClass('image-slideshow-overlay')
|
||||||
.add(closeElement)
|
.add(closeElement)
|
||||||
|
.add(downloadElement)
|
||||||
.add(previousElement)
|
.add(previousElement)
|
||||||
.add(nextElement)
|
.add(nextElement)
|
||||||
.add(figureElement)
|
.add(figureElement)
|
||||||
|
|||||||
@@ -38,3 +38,8 @@
|
|||||||
right: 10px
|
right: 10px
|
||||||
top: 10px
|
top: 10px
|
||||||
font-size: 1.4em
|
font-size: 1.4em
|
||||||
|
|
||||||
|
.slideshow-download-icon
|
||||||
|
left: 10px
|
||||||
|
bottom: 10px
|
||||||
|
font-size: 1.3em
|
||||||
|
|||||||
Reference in New Issue
Block a user