| 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 properties: { | 18 properties: { |
| 19 /** | 19 /** |
| 20 * Alt-text for the dialog close button. |
| 21 */ |
| 22 closeText: String, |
| 23 |
| 24 /** |
| 20 * True if the dialog should remain open on 'popstate' events. This is used | 25 * True if the dialog should remain open on 'popstate' events. This is used |
| 21 * for navigable dialogs that have their separate navigation handling code. | 26 * for navigable dialogs that have their separate navigation handling code. |
| 22 */ | 27 */ |
| 23 ignorePopstate: { | 28 ignorePopstate: { |
| 24 type: Boolean, | 29 type: Boolean, |
| 25 value: false, | 30 value: false, |
| 26 }, | 31 }, |
| 27 }, | 32 }, |
| 28 | 33 |
| 29 /** @override */ | 34 /** @override */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 */ | 52 */ |
| 48 close: function(opt_returnValue) { | 53 close: function(opt_returnValue) { |
| 49 HTMLDialogElement.prototype.close.call(this, 'success'); | 54 HTMLDialogElement.prototype.close.call(this, 'success'); |
| 50 }, | 55 }, |
| 51 | 56 |
| 52 /** @return {!PaperIconButtonElement} */ | 57 /** @return {!PaperIconButtonElement} */ |
| 53 getCloseButton: function() { | 58 getCloseButton: function() { |
| 54 return this.$.close; | 59 return this.$.close; |
| 55 }, | 60 }, |
| 56 }); | 61 }); |
| OLD | NEW |