Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 @license 2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 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.g ithub.io/LICENSE.txt 4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.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/CONTRI BUTORS.txt 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
7 Code distributed by Google as part of the polymer project is also 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/PATEN TS.txt 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
9 --> 9 -->
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ----------------|-------------|---------- 45 ----------------|-------------|----------
46 `--paper-dialog-background-color` | Dialog background color | `--primary-background-color` 46 `--paper-dialog-background-color` | Dialog background color | `--primary-background-color`
47 `--paper-dialog-color` | Dialog foreground color | `--primary-text-color` 47 `--paper-dialog-color` | Dialog foreground color | `--primary-text-color`
48 `--paper-dialog` | Mixin applied to the dialog | `{}` 48 `--paper-dialog` | Mixin applied to the dialog | `{}`
49 `--paper-dialog-title` | Mixin applied to the title (`<h2>`) element | `{}` 49 `--paper-dialog-title` | Mixin applied to the title (`<h2>`) element | `{}`
50 `--paper-dialog-button-color` | Button area foreground color | `--default-primary-color` 50 `--paper-dialog-button-color` | Button area foreground color | `--default-primary-color`
51 51
52 ### Accessibility 52 ### Accessibility
53 53
54 This element has `role="dialog"` by default. Depending on the context, it may be more appropriate 54 This element has `role="dialog"` by default. Depending on the context, it may be more appropriate
55 to override this attribute with `role="alertdialog"`. The header (a `<h2>` eleme nt) will 55 to override this attribute with `role="alertdialog"`.
56 56
57 If `modal` is set, the element will set `aria-modal` and prevent the focus from exiting the element. 57 If `modal` is set, the element will set `aria-modal` and prevent the focus from exiting the element.
58 It will also ensure that focus remains in the dialog. 58 It will also ensure that focus remains in the dialog.
59 59
60 The `aria-labelledby` attribute will be set to the header element, if one exists . 60 The `aria-labelledby` attribute will be set to the header element, if one exists .
61 61
62 @hero hero.svg 62 @hero hero.svg
63 @demo demo/index.html 63 @demo demo/index.html
64 @polymerBehavior Polymer.PaperDialogBehavior 64 @polymerBehavior Polymer.PaperDialogBehavior
65 */ 65 */
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 this.setAttribute('aria-labelledby', labelledById); 166 this.setAttribute('aria-labelledby', labelledById);
167 }, 167 },
168 168
169 _updateClosingReasonConfirmed: function(confirmed) { 169 _updateClosingReasonConfirmed: function(confirmed) {
170 this.closingReason = this.closingReason || {}; 170 this.closingReason = this.closingReason || {};
171 this.closingReason.confirmed = confirmed; 171 this.closingReason.confirmed = confirmed;
172 }, 172 },
173 173
174 _onDialogClick: function(event) { 174 _onDialogClick: function(event) {
175 var target = event.target; 175 var target = event.target;
176 while (target !== this) { 176 while (target && target !== this) {
177 if (target.hasAttribute('dialog-dismiss')) { 177 if (target.hasAttribute) {
178 this._updateClosingReasonConfirmed(false); 178 if (target.hasAttribute('dialog-dismiss')) {
179 this.close(); 179 this._updateClosingReasonConfirmed(false);
180 break; 180 this.close();
181 } else if (target.hasAttribute('dialog-confirm')) { 181 break;
182 this._updateClosingReasonConfirmed(true); 182 } else if (target.hasAttribute('dialog-confirm')) {
183 this.close(); 183 this._updateClosingReasonConfirmed(true);
184 break; 184 this.close();
185 break;
186 }
185 } 187 }
186 target = target.parentNode; 188 target = target.parentNode;
187 } 189 }
188 }, 190 },
189 191
190 _onIronOverlayOpened: function() { 192 _onIronOverlayOpened: function() {
191 if (this.modal) { 193 if (this.modal) {
192 document.body.addEventListener('focus', this._boundOnFocus, true); 194 document.body.addEventListener('focus', this._boundOnFocus, true);
193 this.backdropElement.addEventListener('click', this._boundOnBackdropClic k); 195 this.backdropElement.addEventListener('click', this._boundOnBackdropClic k);
194 } 196 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 230 }
229 } 231 }
230 } 232 }
231 233
232 }; 234 };
233 235
234 /** @polymerBehavior */ 236 /** @polymerBehavior */
235 Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialo gBehaviorImpl]; 237 Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialo gBehaviorImpl];
236 238
237 </script> 239 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698