MOBILE-2474 ux: Scale SVG propperly on iOS

main
Pau Ferrer Ocaña 2018-08-06 15:58:25 +02:00
parent 44917ca99d
commit 06e3f81521
2 changed files with 7 additions and 1 deletions

View File

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

View File

@ -117,6 +117,11 @@ export class CoreFormatTextDirective implements OnChanges {
// Element to wrap the image. // Element to wrap the image.
container = document.createElement('span'); 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.classList.add('core-adapted-img-container');
container.style.cssFloat = img.style.cssFloat; // Copy the float to correctly position the search icon. container.style.cssFloat = img.style.cssFloat; // Copy the float to correctly position the search icon.
if (img.classList.contains('atto_image_button_right')) { if (img.classList.contains('atto_image_button_right')) {