Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview 'cr-dialog' is a component for showing a modal dialog. If the | 6 * @fileoverview 'cr-dialog' is a component for showing a modal dialog. If the |
| 7 * dialog is closed via close(), a 'close' event is fired. If the dialog is | 7 * dialog is closed via close(), a 'close' event is fired. If the dialog is |
| 8 * canceled via cancel(), a 'cancel' event is fired followed by a 'close' event. | 8 * canceled via cancel(), a 'cancel' event is fired followed by a 'close' event. |
| 9 * Additionally clients can inspect the dialog's |returnValue| property inside | 9 * Additionally clients can inspect the dialog's |returnValue| property inside |
| 10 * the 'close' event listener to determine whether it was canceled or just | 10 * the 'close' event listener to determine whether it was canceled or just |
| 11 * closed, where a truthy value means success, and a falsy value means it was | 11 * closed, where a truthy value means success, and a falsy value means it was |
| 12 * canceled. | 12 * canceled. |
| 13 */ | 13 */ |
| 14 Polymer({ | 14 Polymer({ |
| 15 is: 'cr-dialog', | 15 is: 'cr-dialog', |
| 16 extends: 'dialog', | 16 extends: 'dialog', |
| 17 | 17 |
| 18 behaviors: [I18nBehavior], | |
| 19 | |
| 18 properties: { | 20 properties: { |
| 19 /** | 21 /** |
| 20 * True if the dialog should remain open on 'popstate' events. This is used | 22 * True if the dialog should remain open on 'popstate' events. This is used |
| 21 * for navigable dialogs that have their separate navigation handling code. | 23 * for navigable dialogs that have their separate navigation handling code. |
| 22 */ | 24 */ |
| 23 ignorePopstate: { | 25 ignorePopstate: { |
| 24 type: Boolean, | 26 type: Boolean, |
| 25 value: false, | 27 value: false, |
| 26 }, | 28 }, |
| 27 }, | 29 }, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 46 * @override | 48 * @override |
| 47 */ | 49 */ |
| 48 close: function(opt_returnValue) { | 50 close: function(opt_returnValue) { |
| 49 HTMLDialogElement.prototype.close.call(this, 'success'); | 51 HTMLDialogElement.prototype.close.call(this, 'success'); |
| 50 }, | 52 }, |
| 51 | 53 |
| 52 /** @return {!PaperIconButtonElement} */ | 54 /** @return {!PaperIconButtonElement} */ |
| 53 getCloseButton: function() { | 55 getCloseButton: function() { |
| 54 return this.$.close; | 56 return this.$.close; |
| 55 }, | 57 }, |
| 58 | |
| 59 getCloseA11yText_: function() { | |
| 60 return this.i18n('close'); | |
|
Dan Beam
2016/10/27 00:26:27
this 'close' message is added where? in a setting
jdufault
2016/10/27 19:13:55
Yep
| |
| 61 } | |
| 56 }); | 62 }); |
| OLD | NEW |