Lorem ipsum dolor sit amet, consectetur adipisicing elit.
+ + + ` +}) +export class TestDialog { + constructor(public dialogRef: MdDialogRefdiff --git a/e2e/components/fullscreen/fullscreen.e2e.ts b/e2e/components/fullscreen/fullscreen.e2e.ts new file mode 100644 index 00000000000..63a3c65d06e --- /dev/null +++ b/e2e/components/fullscreen/fullscreen.e2e.ts @@ -0,0 +1,38 @@ +import {browser, by, element, Key, ProtractorBy} from 'protractor'; + +describe('fullscreen', () => { + beforeEach(() => browser.get('/fullscreen')); + + let overlayInBody = () => + browser.isElementPresent(by.css('body > .cdk-overlay-container') as ProtractorBy); + let overlayInFullscreen = () => + browser.isElementPresent(by.css('#fullscreenpane > .cdk-overlay-container') as ProtractorBy); + + it('should open a dialog inside a fullscreen element and move it to the document body', () => { + element(by.id('fullscreen')).click(); + element(by.id('dialog')).click(); + + overlayInFullscreen().then((isPresent: boolean) => { + expect(isPresent).toBe(true); + element(by.id('exitfullscreenindialog')).click(); + overlayInBody().then((isPresent: boolean) => { + expect(isPresent).toBe(true); + }); + }); + }); + + it('should open a dialog inside the document body and move it to a fullscreen element', () => { + element(by.id('dialog')).click(); + overlayInBody().then((isPresent: boolean) => { + expect(isPresent).toBe(true); + element(by.id('fullscreenindialog')).click(); + overlayInFullscreen().then((isPresent: boolean) => { + expect(isPresent).toBe(true); + element(by.id('exitfullscreenindialog')).click(); + overlayInBody().then((isPresent: boolean) => { + expect(isPresent).toBe(true); + }); + }); + }); + }); +}); diff --git a/src/demo-app/demo-app-module.ts b/src/demo-app/demo-app-module.ts index b0cccd84959..5f99a3a5422 100644 --- a/src/demo-app/demo-app-module.ts +++ b/src/demo-app/demo-app-module.ts @@ -4,7 +4,8 @@ import {HttpModule} from '@angular/http'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {DemoApp, Home} from './demo-app/demo-app'; import {RouterModule} from '@angular/router'; -import {MaterialModule} from '@angular/material'; +import {MaterialModule, OverlayContainer, + FullscreenOverlayContainer} from '@angular/material'; import {DEMO_APP_ROUTES} from './demo-app/routes'; import {ProgressBarDemo} from './progress-bar/progress-bar-demo'; import {JazzDialog, ContentElementDialog, DialogDemo} from './dialog/dialog-demo'; @@ -94,6 +95,9 @@ import {InputContainerDemo} from './input/input-container-demo'; FoggyTabContent, PlatformDemo ], + providers: [ + {provide: OverlayContainer, useClass: FullscreenOverlayContainer} + ], entryComponents: [ DemoApp, JazzDialog, diff --git a/src/demo-app/demo-app/demo-app.html b/src/demo-app/demo-app/demo-app.html index b48e4a1efab..e3af8f85b27 100644 --- a/src/demo-app/demo-app/demo-app.html +++ b/src/demo-app/demo-app/demo-app.html @@ -25,6 +25,9 @@