mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
hide close button viewer in not overlay mode
This commit is contained in:
parent
393b66602a
commit
2e8644b4bc
@ -20,7 +20,7 @@
|
|||||||
<!-- Start Navigation -->
|
<!-- Start Navigation -->
|
||||||
<nav class="mdl-navigation">
|
<nav class="mdl-navigation">
|
||||||
<div id="viewer-toolbar-view-options">
|
<div id="viewer-toolbar-view-options">
|
||||||
<button
|
<button *ngIf="overlayMode"
|
||||||
class="mdl-color--black mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored" (click)="close()">
|
class="mdl-color--black mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored" (click)="close()">
|
||||||
<i id="viewer-close-button" class="icon material-icons">close</i>
|
<i id="viewer-close-button" class="icon material-icons">close</i>
|
||||||
</button>
|
</button>
|
||||||
|
@ -70,13 +70,14 @@ import { EventMock } from './assets/event.mock';
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('Close button should be present', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
it('Close button should be present if overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
return tcb
|
return tcb
|
||||||
.createAsync(ViewerComponent)
|
.createAsync(ViewerComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
let element = fixture.nativeElement;
|
let element = fixture.nativeElement;
|
||||||
let component = fixture.componentInstance;
|
let component = fixture.componentInstance;
|
||||||
component.urlFile = 'fake-url-file';
|
component.urlFile = 'fake-url-file';
|
||||||
|
component.overlayMode = true;
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
@ -84,6 +85,22 @@ import { EventMock } from './assets/event.mock';
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('Close button should be not present if is not overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
|
return tcb
|
||||||
|
.createAsync(ViewerComponent)
|
||||||
|
.then((fixture) => {
|
||||||
|
let element = fixture.nativeElement;
|
||||||
|
let component = fixture.componentInstance;
|
||||||
|
component.urlFile = 'fake-url-file';
|
||||||
|
component.overlayMode = false;
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(element.querySelector('#viewer-close-button')).toBeNull();
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
it('Click on close button should hide the viewer', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
it('Click on close button should hide the viewer', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
return tcb
|
return tcb
|
||||||
.createAsync(ViewerComponent)
|
.createAsync(ViewerComponent)
|
||||||
@ -91,6 +108,7 @@ import { EventMock } from './assets/event.mock';
|
|||||||
let element = fixture.nativeElement;
|
let element = fixture.nativeElement;
|
||||||
let component = fixture.componentInstance;
|
let component = fixture.componentInstance;
|
||||||
component.urlFile = 'fake-url-file';
|
component.urlFile = 'fake-url-file';
|
||||||
|
component.overlayMode = true;
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
element.querySelector('#viewer-close-button').click();
|
element.querySelector('#viewer-close-button').click();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user