* Change the file display mode.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user