Commit ba603bfc authored by Maggie Cai's avatar Maggie Cai Committed by Commit Bot

Settings: Fix the focus issue after closing the dialog.

Currently in site details page, the focus will be lost after closing the
confirming dialog for clear data and reset settings. This CL fixes this
issue.

BUG=924943,835712

Change-Id: Ia83234f49a25fca0672f3fbe503e620d1002eead
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1496402Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637864}
parent cbb52cd2
......@@ -2,6 +2,8 @@
<link rel="import" href="chrome://resources/html/action_link.html">
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
......@@ -33,12 +35,13 @@
padding-inline-start: var(--settings-box-row-padding);
}
div#resetSettingsButton {
#resetSettingsButton {
margin-top: 24px;
}
</style>
<!-- Confirm reset settings dialog. -->
<cr-dialog id="confirmResetSettings" close-text="$i18n{close}">
<cr-dialog id="confirmResetSettings" close-text="$i18n{close}"
on-close="onResetSettingsDialogClosed_">
<div slot="body">
[[i18n('siteSettingsSiteResetConfirmation', pageTitle)]]
</div>
......@@ -53,7 +56,8 @@
</cr-dialog>
<!-- Confirm clear storage dialog. -->
<cr-dialog id="confirmClearStorage" close-text="$i18n{close}">
<cr-dialog id="confirmClearStorage" close-text="$i18n{close}"
on-close="onClearStorageDialogClosed_">
<div slot="title">
$i18n{siteSettingsSiteClearStorageDialogTitle}
</div>
......@@ -82,8 +86,9 @@
</div>
<div class="list-item" id="storage" hidden$="[[!storedData_]]">
<div class="start">[[storedData_]]</div>
<paper-button class="secondary-button" role="button"
aria-disabled="false" on-click="onConfirmClearStorage_"
<paper-button class="secondary-button" id="clearStorage"
role="button" aria-disabled="false"
on-click="onConfirmClearStorage_"
aria-label="$i18n{siteSettingsDelete}">
$i18n{siteSettingsDelete}
</paper-button>
......
......@@ -258,4 +258,13 @@ Polymer({
return storage != '';
},
/** @private */
onResetSettingsDialogClosed_: function() {
cr.ui.focusWithoutInk(assert(this.$$('#resetSettingsButton')));
},
/** @private */
onClearStorageDialogClosed_: function() {
cr.ui.focusWithoutInk(assert(this.$$('#clearStorage')));
},
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment