diff --git a/module/doc/js/showfiles.ui.js b/module/doc/js/showfiles.ui.js index b69d776d64..73c5cc61d1 100644 --- a/module/doc/js/showfiles.ui.js +++ b/module/doc/js/showfiles.ui.js @@ -58,13 +58,6 @@ window.downloadFile = function(fileID, extension, imageWidth) url += `'${sessionString}'`; width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth * 0.5) ? windowWidth * 0.5 : imageWidth) : windowWidth; - if(fileTypes.includes(extension)) - { - loadModal(url); - } - else - { - loadPage(url); - } + loadModal(url); return false; } diff --git a/module/file/css/download.ui.css b/module/file/css/download.ui.css index ef130797ec..44e728a8c0 100644 --- a/module/file/css/download.ui.css +++ b/module/file/css/download.ui.css @@ -1,5 +1,4 @@ #imageFile > img {margin: 0 auto;} .modal-body #errorMessage {padding: 80px 20px; text-align: center;} -.m-file-download #header, .m-file-download #mainNavbar {display: none;} .m-file-download #mainContent .modal-header {margin-left: 0;} #txtFile > pre {display: block; padding: 10px; border: 1px solid rgb(var(--color-gray-300-rgb)); border-radius: 4px;} diff --git a/module/file/ui/download.html.php b/module/file/ui/download.html.php index e00a20c6eb..899f295660 100644 --- a/module/file/ui/download.html.php +++ b/module/file/ui/download.html.php @@ -43,28 +43,26 @@ else } } - panel + modalHeader ( - modalHeader + set::title($lang->file->preview), + $fileType == 'txt' ? to::suffix ( - set::title($lang->file->preview), - $fileType == 'txt' ? to::suffix + div ( - div - ( - select(setID('charset'), set::name('charset'), set::items($config->file->charset), set::required(true), set::value($charset), set('onchange', 'setCharset(this)'), setClass('ml-2')), - ) - ) : null, - ), - $fileType == 'image' ? div - ( - setID('imageFile'), - h::img(set::src($this->createLink('file', 'read', "fileID={$file->id}"))) - ) : div - ( - setID('txtFile'), - h::pre(set::style(array('background-color' => 'rgb(var(--color-gray-200-rgb))')), $fileContent), - ), + select(setID('charset'), set::name('charset'), set::items($config->file->charset), set::required(true), set::value($charset), set('onchange', 'setCharset(this)'), setClass('ml-2')), + ) + ) : null, + ); + + $fileType == 'image' ? div + ( + setID('imageFile'), + h::img(set::src($this->createLink('file', 'read', "fileID={$file->id}"))) + ) : div + ( + setID('txtFile'), + h::pre(set::style(array('background-color' => 'rgb(var(--color-gray-200-rgb))')), $fileContent), ); $isInModal = isInModal();