Skip to content

Commit

Permalink
fix: move the position of the CSSClass configuration from the 'img' t…
Browse files Browse the repository at this point in the history
…o the 'div' tag
  • Loading branch information
shauke committed Feb 1, 2022
1 parent 037253c commit 8a92b10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
13 changes: 2 additions & 11 deletions src/app/shared/cms/components/cms-image/cms-image.component.html
Expand Up @@ -12,16 +12,7 @@
</ng-container>

<ng-template #image>
<div (deferLoad)="showImage = true" class="defer-load">
<img
*ngIf="showImage"
[src]="pagelet.stringParam('Image')"
[attr.alt]="pagelet.stringParam('AlternateText')"
[ngClass]="pagelet.stringParam('CSSClass')"
/>
<div (deferLoad)="showImage = true" class="defer-load" [ngClass]="pagelet.stringParam('CSSClass')">
<img *ngIf="showImage" [src]="pagelet.stringParam('Image')" [attr.alt]="pagelet.stringParam('AlternateText')" />
</div>
</ng-template>

<!-- TODO: (CMS Component Configuration)
Picture
-->
Expand Up @@ -44,13 +44,8 @@ describe('Cms Image Component', () => {
expect(() => fixture.detectChanges()).not.toThrow();
expect(element).toMatchInlineSnapshot(`
<a class="teaser-link" href="http://example.com" title="bar"
><div class="defer-load">
<img
src="http://example.com/foo/bar.png"
ng-reflect-ng-class="foo"
alt="foo"
class="foo"
/></div
><div class="defer-load foo" ng-reflect-ng-class="foo">
<img src="http://example.com/foo/bar.png" alt="foo" /></div
></a>
`);
});
Expand Down

0 comments on commit 8a92b10

Please sign in to comment.