Commit fc810ef6 authored by dpapad's avatar dpapad Committed by Commit Bot

Settings: Fix focus restoration after subpage exit.

The code stopped working when paper-icon-button-light was updated to its
latest version, which changed the structure of the DOM.

Bug: 860854
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: I0c7189752a5ae47eab0024e3e81775a5f93ee7b6
Reviewed-on: https://chromium-review.googlesource.com/1128463Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573531}
parent 41a4da64
...@@ -37,7 +37,7 @@ Polymer({ ...@@ -37,7 +37,7 @@ Polymer({
if (settings.routes.MANAGE_ACCESSIBILITY) { if (settings.routes.MANAGE_ACCESSIBILITY) {
map.set( map.set(
settings.routes.MANAGE_ACCESSIBILITY.path, settings.routes.MANAGE_ACCESSIBILITY.path,
'#subpage-trigger .subpage-arrow'); '#subpage-trigger .subpage-arrow button');
} }
// </if> // </if>
return map; return map;
......
...@@ -31,7 +31,7 @@ Polymer({ ...@@ -31,7 +31,7 @@ Polymer({
if (settings.routes.ANDROID_APPS_DETAILS) { if (settings.routes.ANDROID_APPS_DETAILS) {
map.set( map.set(
settings.routes.ANDROID_APPS_DETAILS.path, settings.routes.ANDROID_APPS_DETAILS.path,
'#android-apps .subpage-arrow'); '#android-apps .subpage-arrow button');
} }
return map; return map;
}, },
......
...@@ -74,7 +74,7 @@ Polymer({ ...@@ -74,7 +74,7 @@ Polymer({
if (settings.routes.BLUETOOTH_DEVICES) { if (settings.routes.BLUETOOTH_DEVICES) {
map.set( map.set(
settings.routes.BLUETOOTH_DEVICES.path, settings.routes.BLUETOOTH_DEVICES.path,
'#bluetoothDevices .subpage-arrow'); '#bluetoothDevices .subpage-arrow button');
} }
return map; return map;
}, },
......
...@@ -29,7 +29,7 @@ Polymer({ ...@@ -29,7 +29,7 @@ Polymer({
if (settings.routes.CROSTINI_DETAILS) { if (settings.routes.CROSTINI_DETAILS) {
map.set( map.set(
settings.routes.CROSTINI_DETAILS.path, settings.routes.CROSTINI_DETAILS.path,
'#crostini .subpage-arrow'); '#crostini .subpage-arrow button');
} }
return map; return map;
}, },
......
...@@ -41,7 +41,7 @@ Polymer({ ...@@ -41,7 +41,7 @@ Polymer({
if (settings.routes.DATETIME_TIMEZONE_SUBPAGE) if (settings.routes.DATETIME_TIMEZONE_SUBPAGE)
map.set( map.set(
settings.routes.DATETIME_TIMEZONE_SUBPAGE.path, settings.routes.DATETIME_TIMEZONE_SUBPAGE.path,
'#timeZoneSettingsTrigger .subpage-arrow'); '#timeZoneSettingsTrigger .subpage-arrow button');
return map; return map;
}, },
}, },
......
...@@ -59,18 +59,34 @@ Polymer({ ...@@ -59,18 +59,34 @@ Polymer({
type: Object, type: Object,
value: function() { value: function() {
const map = new Map(); const map = new Map();
if (settings.routes.POINTERS) if (settings.routes.POINTERS) {
map.set(settings.routes.POINTERS.path, '#pointersRow .subpage-arrow'); map.set(
if (settings.routes.KEYBOARD) settings.routes.POINTERS.path,
map.set(settings.routes.KEYBOARD.path, '#keyboardRow .subpage-arrow'); '#pointersRow .subpage-arrow button');
if (settings.routes.STYLUS) }
map.set(settings.routes.STYLUS.path, '#stylusRow .subpage-arrow'); if (settings.routes.KEYBOARD) {
if (settings.routes.DISPLAY) map.set(
map.set(settings.routes.DISPLAY.path, '#displayRow .subpage-arrow'); settings.routes.KEYBOARD.path,
if (settings.routes.STORAGE) '#keyboardRow .subpage-arrow button');
map.set(settings.routes.STORAGE.path, '#storageRow .subpage-arrow'); }
if (settings.routes.POWER) if (settings.routes.STYLUS) {
map.set(settings.routes.POWER.path, '#powerRow .subpage-arrow'); map.set(
settings.routes.STYLUS.path, '#stylusRow .subpage-arrow button');
}
if (settings.routes.DISPLAY) {
map.set(
settings.routes.DISPLAY.path,
'#displayRow .subpage-arrow button');
}
if (settings.routes.STORAGE) {
map.set(
settings.routes.STORAGE.path,
'#storageRow .subpage-arrow button');
}
if (settings.routes.POWER) {
map.set(
settings.routes.POWER.path, '#powerRow .subpage-arrow button');
}
return map; return map;
}, },
}, },
......
...@@ -62,7 +62,9 @@ Polymer({ ...@@ -62,7 +62,9 @@ Polymer({
const map = new Map(); const map = new Map();
// <if expr="chromeos"> // <if expr="chromeos">
if (settings.routes.SMB_SHARES) { if (settings.routes.SMB_SHARES) {
map.set(settings.routes.SMB_SHARES.path, '#smbShares .subpage-arrow'); map.set(
settings.routes.SMB_SHARES.path,
'#smbShares .subpage-arrow button');
} }
// </if> // </if>
return map; return map;
......
...@@ -245,7 +245,8 @@ Polymer({ ...@@ -245,7 +245,8 @@ Polymer({
// entire list for now. // entire list for now.
selector = '* /deep/ #networkList'; selector = '* /deep/ #networkList';
} else if (this.detailType_) { } else if (this.detailType_) {
selector = '* /deep/ #' + this.detailType_ + ' /deep/ .subpage-arrow'; selector =
'* /deep/ #' + this.detailType_ + ' /deep/ .subpage-arrow button';
} }
if (selector && this.querySelector(selector)) if (selector && this.querySelector(selector))
this.focusConfig_.set(oldRoute.path, selector); this.focusConfig_.set(oldRoute.path, selector);
......
...@@ -101,14 +101,14 @@ Polymer({ ...@@ -101,14 +101,14 @@ Polymer({
if (settings.routes.EDIT_DICTIONARY) { if (settings.routes.EDIT_DICTIONARY) {
map.set( map.set(
settings.routes.EDIT_DICTIONARY.path, settings.routes.EDIT_DICTIONARY.path,
'#spellCheckCollapse .subpage-arrow'); '#spellCheckCollapse .subpage-arrow button');
} }
// </if> // </if>
// <if expr="chromeos"> // <if expr="chromeos">
if (settings.routes.INPUT_METHODS) { if (settings.routes.INPUT_METHODS) {
map.set( map.set(
settings.routes.INPUT_METHODS.path, settings.routes.INPUT_METHODS.path,
'#inputMethodsCollapse .subpage-arrow'); '#inputMethodsCollapse .subpage-arrow button');
} }
// </if> // </if>
return map; return map;
......
...@@ -25,7 +25,7 @@ Polymer({ ...@@ -25,7 +25,7 @@ Polymer({
if (settings.routes.MANAGE_PASSWORDS) { if (settings.routes.MANAGE_PASSWORDS) {
this.focusConfig_.set( this.focusConfig_.set(
settings.routes.MANAGE_PASSWORDS.path, settings.routes.MANAGE_PASSWORDS.path,
'#passwordManagerButton .subpage-arrow'); '#passwordManagerButton .subpage-arrow button');
} }
}, },
......
...@@ -136,8 +136,10 @@ Polymer({ ...@@ -136,8 +136,10 @@ Polymer({
type: Object, type: Object,
value: function() { value: function() {
const map = new Map(); const map = new Map();
if (settings.routes.SYNC) if (settings.routes.SYNC) {
map.set(settings.routes.SYNC.path, '#sync-status .subpage-arrow'); map.set(
settings.routes.SYNC.path, '#sync-status .subpage-arrow button');
}
if (settings.routes.MANAGE_PASSWORDS) { if (settings.routes.MANAGE_PASSWORDS) {
map.set( map.set(
settings.routes.MANAGE_PASSWORDS.path, '#passwordManagerButton'); settings.routes.MANAGE_PASSWORDS.path, '#passwordManagerButton');
...@@ -149,24 +151,24 @@ Polymer({ ...@@ -149,24 +151,24 @@ Polymer({
if (settings.routes.MANAGE_PROFILE) { if (settings.routes.MANAGE_PROFILE) {
map.set( map.set(
settings.routes.MANAGE_PROFILE.path, settings.routes.MANAGE_PROFILE.path,
'#picture-subpage-trigger .subpage-arrow'); '#picture-subpage-trigger .subpage-arrow button');
} }
// </if> // </if>
// <if expr="chromeos"> // <if expr="chromeos">
if (settings.routes.CHANGE_PICTURE) { if (settings.routes.CHANGE_PICTURE) {
map.set( map.set(
settings.routes.CHANGE_PICTURE.path, settings.routes.CHANGE_PICTURE.path,
'#picture-subpage-trigger .subpage-arrow'); '#picture-subpage-trigger .subpage-arrow button');
} }
if (settings.routes.LOCK_SCREEN) { if (settings.routes.LOCK_SCREEN) {
map.set( map.set(
settings.routes.LOCK_SCREEN.path, settings.routes.LOCK_SCREEN.path,
'#lock-screen-subpage-trigger .subpage-arrow'); '#lock-screen-subpage-trigger .subpage-arrow button');
} }
if (settings.routes.ACCOUNTS) { if (settings.routes.ACCOUNTS) {
map.set( map.set(
settings.routes.ACCOUNTS.path, settings.routes.ACCOUNTS.path,
'#manage-other-people-subpage-trigger .subpage-arrow'); '#manage-other-people-subpage-trigger .subpage-arrow button');
} }
// </if> // </if>
return map; return map;
......
...@@ -24,13 +24,13 @@ Polymer({ ...@@ -24,13 +24,13 @@ Polymer({
if (settings.routes.CLOUD_PRINTERS) { if (settings.routes.CLOUD_PRINTERS) {
map.set( map.set(
settings.routes.CLOUD_PRINTERS.path, settings.routes.CLOUD_PRINTERS.path,
'#cloudPrinters .subpage-arrow'); '#cloudPrinters .subpage-arrow button');
} }
// <if expr="chromeos"> // <if expr="chromeos">
if (settings.routes.CUPS_PRINTERS) { if (settings.routes.CUPS_PRINTERS) {
map.set( map.set(
settings.routes.CUPS_PRINTERS.path, settings.routes.CUPS_PRINTERS.path,
'#cupsPrinters .subpage-arrow'); '#cupsPrinters .subpage-arrow button');
} }
// </if> // </if>
return map; return map;
......
...@@ -100,13 +100,13 @@ Polymer({ ...@@ -100,13 +100,13 @@ Polymer({
if (settings.routes.CERTIFICATES) { if (settings.routes.CERTIFICATES) {
map.set( map.set(
settings.routes.CERTIFICATES.path, settings.routes.CERTIFICATES.path,
'#manageCertificates .subpage-arrow'); '#manageCertificates .subpage-arrow button');
} }
// </if> // </if>
if (settings.routes.SITE_SETTINGS) { if (settings.routes.SITE_SETTINGS) {
map.set( map.set(
settings.routes.SITE_SETTINGS.path, settings.routes.SITE_SETTINGS.path,
'#site-settings-subpage-trigger .subpage-arrow'); '#site-settings-subpage-trigger .subpage-arrow button');
} }
return map; return map;
}, },
......
...@@ -84,13 +84,13 @@ Polymer({ ...@@ -84,13 +84,13 @@ Polymer({
if (settings.routes.SEARCH_ENGINES) { if (settings.routes.SEARCH_ENGINES) {
this.focusConfig_.set( this.focusConfig_.set(
settings.routes.SEARCH_ENGINES.path, settings.routes.SEARCH_ENGINES.path,
'#engines-subpage-trigger .subpage-arrow'); '#engines-subpage-trigger .subpage-arrow button');
} }
// <if expr="chromeos"> // <if expr="chromeos">
if (settings.routes.GOOGLE_ASSISTANT) { if (settings.routes.GOOGLE_ASSISTANT) {
this.focusConfig_.set( this.focusConfig_.set(
settings.routes.GOOGLE_ASSISTANT.path, settings.routes.GOOGLE_ASSISTANT.path,
'#assistant-subpage-trigger .subpage-arrow'); '#assistant-subpage-trigger .subpage-arrow button');
} }
// </if> // </if>
}, },
......
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