[UI] Small improvement on attachment's visual

This commit is contained in:
Diogo Cordeiro 2020-04-07 02:45:48 +01:00 committed by Diogo Peralta Cordeiro
parent 617e3af5cd
commit 4caa394db6
2 changed files with 11 additions and 8 deletions

View File

@ -111,6 +111,8 @@ class AttachmentListItem extends Widget
$this->out->element('a', $this->linkAttr(), $this->title()); $this->out->element('a', $this->linkAttr(), $this->title());
$this->out->elementEnd('label'); $this->out->elementEnd('label');
$this->out->element('br');
if (!empty($enclosure->mimetype)) { if (!empty($enclosure->mimetype)) {
// First, prepare a thumbnail if it exists. // First, prepare a thumbnail if it exists.
$thumb = null; $thumb = null;

View File

@ -148,11 +148,12 @@ html .tagcontainer > footer > .attachments > .inline-attachment > .attachment-wr
html[data-hidesensitive='true'] .tagcontainer.data-tag-nsfw > footer > .attachments > .inline-attachment > .attachment-wrapper > .sensitive-blocker { html[data-hidesensitive='true'] .tagcontainer.data-tag-nsfw > footer > .attachments > .inline-attachment > .attachment-wrapper > .sensitive-blocker {
display: block; display: block;
width: 100%; /* hugh, two magic numbers below, sorry :( */
height: 100%; width: 98%;
height: 90%;
position: absolute; position: absolute;
z-index: 100; /* z-index: 100; */
/*background-color: #d4baba;*/ /* background-color: #d4baba; */
background-color: black; background-color: black;
background-image: url({$blocker}); background-image: url({$blocker});
background-repeat: no-repeat; background-repeat: no-repeat;
@ -179,17 +180,17 @@ EOB;
} catch (Exception $e) { } catch (Exception $e) {
$thumbnail = null; $thumbnail = null;
} }
$thumb_width_css = $thumbnail ? $thumbnail->width . 'px' : '100%'; // $thumb_width_css = $thumbnail ? $thumbnail->width . 'px' : '100%';
$thumb_height_css = $thumbnail ? $thumbnail->height . 'px' : '100%'; // $thumb_height_css = $thumbnail ? $thumbnail->height . 'px' : '100%';
$out->elementStart('div', [ $out->elementStart('div', [
'class' => 'attachment-wrapper', 'class' => 'attachment-wrapper',
'style' => "height: {$thumb_height_css}; width: {$thumb_width_css};", /* 'style' => "height: {$thumb_height_css}; width: {$thumb_width_css};", */
]); // needs height of thumb ]); // needs height of thumb
$out->elementStart('div', [ $out->elementStart('div', [
'class' => $classes, 'class' => $classes,
'onclick' => 'toggleSpoiler(event)', 'onclick' => 'toggleSpoiler(event)',
'style' => "height: {$thumb_height_css}; width: {$thumb_width_css};", /* 'style' => "height: {$thumb_height_css}; width: {$thumb_width_css};", */
]); ]);
$out->raw(' '); $out->raw(' ');
$out->elementEnd('div'); $out->elementEnd('div');