1<!doctype html> 2<!-- 3@license 4Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 5This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 6The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 7The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 8Code distributed by Google as part of the polymer project is also 9subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 10--> 11<html> 12<head> 13 14 <meta charset="utf-8"> 15 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 16 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> 17 18 <title>paper-dialog-behavior demo</title> 19 20 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> 21 22 <link rel="import" href="simple-dialog.html"> 23 24 <link rel="import" href="../../paper-button/paper-button.html"> 25 <link rel="import" href="../../paper-dropdown-menu/paper-dropdown-menu.html"> 26 <link rel="import" href="../../paper-item/paper-item.html"> 27 <link rel="import" href="../../paper-listbox/paper-listbox.html"> 28 <link rel="import" href="../../paper-dialog-scrollable/paper-dialog-scrollable.html"> 29 <link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> 30 <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> 31 32 <style is="custom-style" include="demo-pages-shared-styles"></style> 33</head> 34<body unresolved class="centered"> 35 36 <h3>An element with <code>PaperDialogBehavior</code> can be opened, closed, toggled. Use <code>h2</code> for the title</h3> 37 <demo-snippet class="centered-demo"> 38 <template> 39 <paper-button raised onclick="dialog.toggle()">dialog</paper-button> 40 <simple-dialog id="dialog"> 41 <h2>Dialog Title</h2> 42 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 43 </simple-dialog> 44 </template> 45 </demo-snippet> 46 47 <h3>An element with <code>PaperDialogBehavior</code> can be modal. Use the attributes <code>dialog-dismiss</code> and <code>dialog-confirm</code> on the children to close it.</h3> 48 <demo-snippet class="centered-demo"> 49 <template> 50 <paper-button raised onclick="modalAlert.toggle()">modal alert</paper-button> 51 <simple-dialog id="modalAlert" modal role="alertdialog"> 52 <h2>Alert</h2> 53 <paper-dropdown-menu label="Draft to discard"> 54 <paper-listbox class="dropdown-content"> 55 <paper-item>Draft 1</paper-item> 56 <paper-item>Draft 2</paper-item> 57 <paper-item>Draft 3</paper-item> 58 <paper-item>Draft 4</paper-item> 59 </paper-listbox> 60 </paper-dropdown-menu> 61 <div class="buttons"> 62 <paper-button onclick="modalDetails.toggle()">More details</paper-button> 63 <paper-button dialog-dismiss>Cancel</paper-button> 64 <paper-button dialog-confirm autofocus>Discard</paper-button> 65 </div> 66 </simple-dialog> 67 <simple-dialog id="modalDetails" modal> 68 <h2>Details</h2> 69 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 70 <div class="buttons"> 71 <paper-button dialog-confirm autofocus>OK</paper-button> 72 </div> 73 </simple-dialog> 74 </template> 75 </demo-snippet> 76 77 <h3>Use <code>paper-dialog-scrollable</code> for scrolling content</h3> 78 <demo-snippet class="centered-demo"> 79 <template> 80 <paper-button raised onclick="scrolling.toggle()">scrolling</paper-button> 81 <simple-dialog id="scrolling"> 82 <h2>Scrolling</h2> 83 <paper-dialog-scrollable> 84 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 85 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 86 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 87 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 88 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 89 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 90 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 91 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 92 </paper-dialog-scrollable> 93 <div class="buttons"> 94 <paper-button dialog-dismiss>Cancel</paper-button> 95 <paper-button dialog-confirm>OK</paper-button> 96 </div> 97 </simple-dialog> 98 </template> 99 </demo-snippet> 100 101</body> 102</html> 103