Skip to content
Snippets Groups Projects
Commit a07392f2 authored by Hartung, Michael's avatar Hartung, Michael
Browse files

app-images

parent af83f638
Branches
Tags
No related merge requests found
......@@ -55,6 +55,7 @@ import { InfoTileEdgeComponent } from './components/info-tile-edge/info-tile-edg
import { NetworkEmptyWarningComponent } from './components/network-empty-warning/network-empty-warning.component';
import { BugReportComponent } from './components/bug-report/bug-report.component';
import { ViewListComponent } from './components/analysis-panel/view-list/view-list.component';
import { ImageComponent } from './image/image.component';
@NgModule({
......@@ -99,6 +100,7 @@ import { ViewListComponent } from './components/analysis-panel/view-list/view-li
NetworkEmptyWarningComponent,
BugReportComponent,
ViewListComponent,
ImageComponent,
],
imports: [
BrowserModule,
......
<p
*ngIf="!wrapper.data.drugstoneId && wrapper.data.label"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"
......@@ -174,15 +173,26 @@
[href]="getLinkoutURL(target.key)"
target="_blank"
>
<img class="link-icon" src="assets/{{ target.value }}.png" alt="{{ target.value }}" title="{{ target.value }}"/></a
>
<app-image
_class="link-icon"
_src="assets/{{ target.value }}.png"
_alt="{{ target.value }}"
_title="{{ target.value }}"
></app-image>
</a>
</span>
&nbsp;
<a
class="is-capitalized"
href="https://clinicaltrials.gov/ct2/results?term={{ wrapper.data.symbol }}"
target="_blank"
><img class="link-icon" src="assets/clinicaltrials.png" alt="ClinicalTrials.gov" title="ClinicalTrials.gov"/>
>
<app-image
_class="link-icon"
_src="assets/clinicaltrials.png"
_alt="ClinicalTrials.gov"
_title="ClinicalTrials.gov"
></app-image>
</a>
</p>
......
.link-icon {
height: 1.2em !important;
vertical-align: bottom !important;
}
\ No newline at end of file
<picture>
<source srcset="{{ _source }}" />
<img
src="{{ _source }}"
alt="{{ _alt }}"
title="{{ _title }}"
class="{{ _class }}"
/>
</picture>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ImageComponent } from './image.component';
describe('ImageComponent', () => {
let component: ImageComponent;
let fixture: ComponentFixture<ImageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ImageComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ImageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'app-image',
templateUrl: './image.component.html',
styleUrls: ['./image.component.scss']
})
export class ImageComponent implements OnInit {
constructor() { }
public _source: string;
public format: string;
@Input() set _src(src: string) {
this._source = src;
// get file ending behind last '.' as format
this.format = this._source.split('.').slice(-1)[0];
}
@Input() _alt: string;
@Input() _title: string;
@Input() _class: string;
ngOnInit(): void {
}
}
......@@ -321,3 +321,7 @@
}
}
.link-icon {
height: 1.2em !important;
vertical-align: bottom !important;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment