Merge pull request #1623 from crazyserver/MOBILE-2730

MOBILE-2730 style: Improve atto image alignment
main
Juan Leyva 2018-11-23 10:59:03 +01:00 committed by GitHub
commit ac9bd47da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 15 deletions

View File

@ -637,40 +637,47 @@ ion-app.app-root {
display: inline-block;
}
.atto_image_button_text-top,
.atto_image_button_middle,
.atto_image_button_text-bottom,
.atto_image_button_left,
.atto_image_button_right {
vertical-align: middle;
max-width: 100%;
height: auto;
width: auto;
display: inline-block;
margin: 0 0.5em;
&.img-responsive {
/* If the image is display: block then linking the image to URLs won't work. */
/*display: inline-block;*/
max-width: 100%;
height: auto;
width: auto;
}
}
.atto_image_button_text-top {
vertical-align: text-top;
margin: 0 0.5em;
}
.atto_image_button_middle {
vertical-align: middle;
margin: 0 0.5em;
}
vertical-align: middle; }
.atto_image_button_text-bottom {
vertical-align: text-bottom;
margin: 0 0.5em;
}
.atto_image_button_text-top.img-responsive,
.atto_image_button_middle.img-responsive,
.atto_image_button_text-bottom.img-responsive {
/* If the image is display: block then linking the image to URLs won't work. */
display: inline-block;
max-width: calc(100% - 1em);
}
/*rtl:begin:ignore*/
.atto_image_button_left {
@include float(start);
@include margin(0, 0.5em, 0, 0);
max-width: calc(100% - 1em);
}
.atto_image_button_right {
@include float(end);
@include margin(0, 0, 0, 0.5em);
max-width: calc(100% - 1em);
}
/*rtl:end:ignore*/

View File

@ -137,6 +137,12 @@ export class CoreFormatTextDirective implements OnChanges {
container.classList.add('atto_image_button_right');
} else if (img.classList.contains('atto_image_button_left')) {
container.classList.add('atto_image_button_left');
} else if (img.classList.contains('atto_image_button_text-top')) {
container.classList.add('atto_image_button_text-top');
} else if (img.classList.contains('atto_image_button_middle')) {
container.classList.add('atto_image_button_middle');
} else if (img.classList.contains('atto_image_button_text-bottom')) {
container.classList.add('atto_image_button_text-bottom');
}
this.domUtils.wrapElement(img, container);