-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(overlay): add overlay container & styles
- Loading branch information
Showing
9 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {DOM} from '../platform/dom/dom_adapter'; | ||
|
||
|
||
/** | ||
* Create the overlay container element, which is simply a div | ||
* with the 'md-overlay-container' class on the document body. | ||
*/ | ||
export function createOverlayContainer(): Element { | ||
let documentBody = DOM.getGlobalEventTarget('body'); | ||
let container = DOM.createElement('div'); | ||
DOM.addClass(container, 'md-overlay-container'); | ||
DOM.appendChild(documentBody, container); | ||
return container; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** The overlay-container is an invisible element which contains all individual overlays. */ | ||
.md-overlay-container { | ||
position: absolute; | ||
|
||
// Disable events from being captured on the overlay container. | ||
pointer-events: none; | ||
|
||
// The container should be the size of the viewport. | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
/** A single overlay pane. */ | ||
.md-overlay-pane { | ||
position: absolute; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import "package:angular2/platform/browser.dart" show bootstrap; | ||
import "./demo-app/demo-app.dart" show DemoApp; | ||
import "package:angular2/router.dart" show ROUTER_PROVIDERS; | ||
import "./core/platform/browser/browser_adapter.dart" show BrowserDomAdapter; | ||
|
||
void main() { | ||
BrowserDomAdapter.makeCurrent(); | ||
bootstrap(DemoApp, [ROUTER_PROVIDERS]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Main library CSS file that will eventually be delivered as angular2-material.css. | ||
// Contains CSS rules that users will consume throughout their application as well as rules | ||
// that are consumed across multiple components (and thus shouldn't be scoped). | ||
|
||
@import "core/overlay/overlay"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import {bootstrap} from 'angular2/platform/browser'; | ||
import {DemoApp} from './demo-app/demo-app'; | ||
import {ROUTER_PROVIDERS} from 'angular2/router'; | ||
import {BrowserDomAdapter} from './core/platform/browser/browser_adapter'; | ||
import {OVERLAY_CONTAINER_TOKEN} from './core/overlay/overlay'; | ||
import {provide} from 'angular2/core'; | ||
import {createOverlayContainer} from './core/overlay/overlay-container'; | ||
|
||
BrowserDomAdapter.makeCurrent(); | ||
|
||
bootstrap(DemoApp, [ | ||
ROUTER_PROVIDERS | ||
ROUTER_PROVIDERS, | ||
provide(OVERLAY_CONTAINER_TOKEN, {useValue: createOverlayContainer()}), | ||
]); |