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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_animated_pages.js

Issue 2842303004: MD Settings: update dialogs to focus without ink when using mouse (Closed)
Patch Set: merge Created 3 years, 8 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
Index: chrome/browser/resources/settings/settings_page/settings_animated_pages.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index 5c7566d9f347c4ac97b0de933f00833e7c0c7532..b90aefefae59a80fcaa6960ba5dd79815364b239 100644
--- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -51,11 +51,6 @@ Polymer({
Polymer.dom(this).observeNodes(this.lightDomChanged_.bind(this));
},
- /** @override */
- attached: function() {
- this.outline_ = cr.ui.FocusOutlineManager.forDocument(document);
- },
-
/**
* @param {!Event} e
* @private
@@ -86,24 +81,11 @@ Polymer({
var selector = this.focusConfig.get(this.previousRoute_.path);
if (selector) {
// neon-animatable has "display: none" until the animation finishes, so
- // calling focus() on any of its children has no effect until
- // "display: none" is removed. Therefore can't call focus() from within
- // the currentRouteChanged callback. Using 'iron-select' listener which
- // fires after the animation has finished allows focus() to work as
- // expected.
- var toFocus = this.querySelector(selector);
- var suppressInk = !this.outline_.visible;
- var origNoInk;
-
- if (suppressInk) {
- origNoInk = toFocus.noink;
- toFocus.noink = true;
- }
-
- toFocus.focus();
-
- if (suppressInk)
- toFocus.noink = origNoInk;
+ // calling focus() on any of its children has no effect until "display:
+ // none" is removed. Therefore, don't set focus from within the
+ // currentRouteChanged callback. Using 'iron-select' listener which fires
+ // after the animation has finished allows setting focus to work.
+ cr.ui.focusWithoutInk(assert(this.querySelector(selector)));
}
},

Powered by Google App Engine
This is Rietveld 408576698