MOBILE-3074 format-text: No magnifying glasses for images inside links

main
Albert Gasset 2019-07-29 10:16:10 +02:00
parent 90f340aaa5
commit 7507e93068
1 changed files with 5 additions and 0 deletions

View File

@ -168,6 +168,11 @@ export class CoreFormatTextDirective implements OnChanges {
const elWidth = this.getElementWidth(this.element) || window.innerWidth;
imgs.forEach((img: HTMLImageElement) => {
// Skip image if it's inside a link.
if (img.closest('a')) {
return;
}
let imgWidth = parseInt(img.getAttribute('width'));
if (!imgWidth) {
// No width attribute, use real size.