mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Update for display of SVG thumbnails in admin InputfieldImage
This commit is contained in:
2
wire/modules/Inputfield/InputfieldImage/InputfieldImage.css
Executable file → Normal file
2
wire/modules/Inputfield/InputfieldImage/InputfieldImage.css
Executable file → Normal file
File diff suppressed because one or more lines are too long
@@ -59,7 +59,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
|
||||
return array(
|
||||
'title' => __('Images', __FILE__), // Module Title
|
||||
'summary' => __('One or more image uploads (sortable)', __FILE__), // Module Summary
|
||||
'version' => 126,
|
||||
'version' => 127,
|
||||
'permanent' => true,
|
||||
);
|
||||
}
|
||||
@@ -659,8 +659,12 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
|
||||
if($extra->exists()) $fileStats .= " • $extra->filesizeStr $name ($extra->savingsPct)";
|
||||
}
|
||||
|
||||
$class = 'gridImage__overflow';
|
||||
if($pagefile->ext() === 'svg') {
|
||||
$class .= ' ' . ($pagefile->ratio < 1 ? 'portrait' : 'landscape');
|
||||
}
|
||||
$out = $this->getTooltip($pagefile) . "
|
||||
<div class='gridImage__overflow'>
|
||||
<div class='$class'>
|
||||
$thumb[markup]
|
||||
</div>
|
||||
";
|
||||
|
@@ -942,6 +942,23 @@ $focusPointCircleSize: 40px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.InputfieldImageList {
|
||||
// for .svg images
|
||||
.gridImage__overflow.landscape {
|
||||
img { height: 100%; }
|
||||
}
|
||||
.gridImage__overflow.portrait {
|
||||
img { width: 100%; }
|
||||
}
|
||||
}
|
||||
|
||||
.InputfieldImageList[data-ragged="1"] {
|
||||
// for .svg images
|
||||
.gridImage__overflow.portrait {
|
||||
img { width: auto; height: 100%; }
|
||||
}
|
||||
}
|
||||
|
||||
/* todo: 3.0.190 improves touch support but needs further testing
|
||||
.gridImage__edit { display:block !important; }
|
||||
.gridImage__edit span { display:none; }
|
||||
|
Reference in New Issue
Block a user