Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components / paper-dialog / paper-dialog.html
blob002e242c9db9ac1b5db0f9570c5546274250d985
1 <!--
2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 -->
11 <link rel="import" href="../polymer/polymer.html">
12 <link rel="import" href="../neon-animation/neon-animation-runner-behavior.html">
13 <link rel="import" href="../paper-dialog-behavior/paper-dialog-behavior.html">
14 <link rel="import" href="../paper-styles/paper-styles.html">
16 <!--
17 `<paper-dialog>` is a dialog with Material Design styling and optional animations when it is
18 opened or closed. It provides styles for a header, content area, and an action area for buttons.
19 You can use the `<paper-dialog-scrollable` element (in its own repository) if you need a scrolling
20 content area. See `Polymer.PaperDialogBehavior` for specifics.
22 For example, the following code implements a dialog with a header, scrolling content area and
23 buttons.
25 <paper-dialog>
26 <h2>Header</h2>
27 <paper-dialog-scrollable>
28 Lorem ipsum...
29 </paper-dialog-scrollable>
30 <div class="buttons">
31 <paper-button dialog-dismiss>Cancel</paper-button>
32 <paper-button dialog-confirm>Accept</paper-button>
33 </div>
34 </paper-dialog>
36 ### Styling
38 See the docs for `Polymer.PaperDialogBehavior` for the custom properties available for styling
39 this element.
41 ### Animations
43 Set the `entry-animation` and/or `exit-animation` attributes to add an animation when the dialog
44 is opened or closed. See the documentation in
45 [PolymerElements/neon-animation](https://github.com/PolymerElements/neon-animation) for more info.
47 For example:
49 <link rel="import" href="components/neon-animation/animations/scale-up-animation.html">
50 <link rel="import" href="components/neon-animation/animations/fade-out-animation.html">
52 <paper-dialog entry-animation="scale-up-animation"
53 exit-animation="fade-out-animation">
54 <h2>Header</h2>
55 <div>Dialog body</div>
56 </paper-dialog>
58 ### Accessibility
60 See the docs for `Polymer.PaperDialogBehavior` for accessibility features implemented by this
61 element.
63 @group Paper Elements
64 @element paper-dialog
65 @hero hero.svg
66 @demo demo/index.html
67 -->
69 <dom-module id="paper-dialog">
71 <link rel="import" type="css" href="../paper-dialog-behavior/paper-dialog-common.css">
73 <template>
74 <content></content>
75 </template>
77 </dom-module>
79 <script>
81 (function() {
83 Polymer({
85 is: 'paper-dialog',
87 behaviors: [
88 Polymer.PaperDialogBehavior,
89 Polymer.NeonAnimationRunnerBehavior
92 listeners: {
93 'neon-animation-finish': '_onNeonAnimationFinish'
96 _renderOpened: function() {
97 if (this.withBackdrop) {
98 this.backdropElement.open();
100 this.playAnimation('entry');
103 _renderClosed: function() {
104 if (this.withBackdrop) {
105 this.backdropElement.close();
107 this.playAnimation('exit');
110 _onNeonAnimationFinish: function() {
111 if (this.opened) {
112 this._finishRenderOpened();
113 } else {
114 this._finishRenderClosed();
120 })();
122 </script>