1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Set "max-width: 100%" on "size=full" Remarkup images

Summary: Fixes T5500. When an image is embedded with `{Fxx, size=full}`, add "max-width: 100%;" so that large images are scaled down to the size of the container. This seems like a better and more reasonable behavior than having them scroll. You can still lightbox them or right-click -> view if you really want the full image.

Test Plan: Dragged window around with a very large `size=full` image. At large window sizes, the image displayed at 100%. At smaller window sizes, the image was scaled to fit.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5500

Differential Revision: https://secure.phabricator.com/D9758
This commit is contained in:
epriestley 2014-06-27 10:29:43 -07:00
parent e42e8aa618
commit 32a42f37fe
3 changed files with 7 additions and 5 deletions

View file

@ -7,7 +7,7 @@
return array(
'names' =>
array(
'core.pkg.css' => 'a18bafdb',
'core.pkg.css' => '9156dd94',
'core.pkg.js' => '834b4eda',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37',
@ -104,7 +104,7 @@ return array(
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de',
'rsrc/css/core/core.css' => '40151074',
'rsrc/css/core/remarkup.css' => 'cc2d4ed8',
'rsrc/css/core/remarkup.css' => 'ad4c0676',
'rsrc/css/core/syntax.css' => '3c18c1cb',
'rsrc/css/core/z-index.css' => 'd1c137f2',
'rsrc/css/diviner/diviner-shared.css' => '38813222',
@ -732,7 +732,7 @@ return array(
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '41ed7994',
'phabricator-profile-css' => 'b459416e',
'phabricator-remarkup-css' => 'cc2d4ed8',
'phabricator-remarkup-css' => 'ad4c0676',
'phabricator-search-results-css' => 'f240504c',
'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'a2ccd7bd',

View file

@ -96,8 +96,6 @@ final class PhabricatorRemarkupRuleEmbedFile
case 'full':
$attrs += array(
'src' => $file->getBestURI(),
'width' => $file->getImageWidth(),
'height' => $file->getImageHeight(),
);
$image_class = 'phabricator-remarkup-embed-image-full';
break;

View file

@ -301,6 +301,10 @@
display: inline-block;
}
.phabricator-remarkup-embed-image-full img {
max-width: 100%;
}
.phabricator-remarkup table.remarkup-table {
border-collapse: separate;
border-spacing: 1px;