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

Unified Diff: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js

Issue 2445713004: MD Settings: Don't auto-close navigable dialogs on popstate. (Closed)
Patch Set: rename attribute Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/reset_page/reset_profile_dialog.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
index fc13095d5eec9c815c1c54e713b4f6206a0a0f11..3f906ef06ed653a3d999a1a4c1b7f477677667f8 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
@@ -15,12 +15,23 @@ Polymer({
is: 'cr-dialog',
extends: 'dialog',
+ properties: {
+ /**
+ * True if the dialog should remain open on 'popstate' events. This is used
+ * for navigable dialogs that have their separate navigation handling code.
+ */
+ ignorePopstate: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
/** @override */
- created: function() {
+ ready: function() {
// If the active history entry changes (i.e. user clicks back button),
// all open dialogs should be cancelled.
window.addEventListener('popstate', function() {
- if (this.open)
+ if (!this.ignorePopstate && this.open)
this.cancel();
}.bind(this));
},
« no previous file with comments | « chrome/browser/resources/settings/reset_page/reset_profile_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698