Merge pull request #1463 from crazyserver/MOBILE-2474

MOBILE-2474 ux: Scale SVG propperly on iOS
main
Juan Leyva 2018-08-22 12:12:15 +01:00 committed by GitHub
commit 1e987c6f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -32,7 +32,6 @@
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.opacity-hide { opacity: 0; }
@ -270,6 +269,7 @@ core-format-text[ng-reflect-single-line="true"] {
}
img.core-media-adapt-width {
width: 100%;
height: auto;
}
@ -280,6 +280,7 @@ audio.core-media-adapt-width {
.core-adapted-img-container {
position: relative;
display: inline-block;
width: 100%;
}
.core-image-viewer-icon {

View File

@ -117,6 +117,11 @@ export class CoreFormatTextDirective implements OnChanges {
// Element to wrap the image.
container = document.createElement('span');
const forcedWidth = parseInt(img.attributes.getNamedItem('width').value);
if (!isNaN(forcedWidth) && img.attributes.getNamedItem('width').value.indexOf('%') < 0) {
img.style.width = forcedWidth + 'px';
}
container.classList.add('core-adapted-img-container');
container.style.cssFloat = img.style.cssFloat; // Copy the float to correctly position the search icon.
if (img.classList.contains('atto_image_button_right')) {