1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +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( return array(
'names' => 'names' =>
array( array(
'core.pkg.css' => 'a18bafdb', 'core.pkg.css' => '9156dd94',
'core.pkg.js' => '834b4eda', 'core.pkg.js' => '834b4eda',
'darkconsole.pkg.js' => 'df001cab', 'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37', 'differential.pkg.css' => '4a93db37',
@ -104,7 +104,7 @@ return array(
'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/application/uiexample/example.css' => '528b19de',
'rsrc/css/core/core.css' => '40151074', '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/syntax.css' => '3c18c1cb',
'rsrc/css/core/z-index.css' => 'd1c137f2', 'rsrc/css/core/z-index.css' => 'd1c137f2',
'rsrc/css/diviner/diviner-shared.css' => '38813222', 'rsrc/css/diviner/diviner-shared.css' => '38813222',
@ -732,7 +732,7 @@ return array(
'phabricator-phtize' => 'd254d646', 'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '41ed7994', 'phabricator-prefab' => '41ed7994',
'phabricator-profile-css' => 'b459416e', 'phabricator-profile-css' => 'b459416e',
'phabricator-remarkup-css' => 'cc2d4ed8', 'phabricator-remarkup-css' => 'ad4c0676',
'phabricator-search-results-css' => 'f240504c', 'phabricator-search-results-css' => 'f240504c',
'phabricator-shaped-request' => '7cbe244b', 'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'a2ccd7bd', 'phabricator-side-menu-view-css' => 'a2ccd7bd',

View file

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

View file

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