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

Unified Diff: chrome/browser/resources/settings/focusable_iron_list_item_behavior.js

Issue 2749513004: MD Settings: adjust iron-list focus row behaviors. (Closed)
Patch Set: fix test Created 3 years, 9 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/focusable_iron_list_item_behavior.js
diff --git a/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js b/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
deleted file mode 100644
index 20e58c5b7db3efe8ef953cdc7253e5ea82a0e0e5..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/** @polymerBehavior */
-var FocusableIronListItemBehavior = {
- properties: {
- /** @private {boolean} */
- focusedByKey_: Boolean,
- },
-
- listeners: {
- 'keyup': 'onKeyUp_',
- 'keydown': 'onKeyDown_',
- 'mousedown': 'onMouseDown_',
- 'blur': 'onBlur_',
- },
-
- /**
- * Flag that `this` is focused by keyboard, so mouse click doesn't apply
- * the .no-outline class.
- * @private
- */
- onKeyUp_: function() {
- // If refocusing on child, row itself isn't focused by keyboard anymore.
- if (!this.$$('[focused]'))
- this.focusedByKey_ = true;
- },
-
- /**
- * Unflag when moving away via keyboard (e.g. tabbing onto its children).
- * @param {!Event} event
- * @private
- */
- onKeyDown_: function(event) {
- this.focusedByKey_ = false;
-
- // For these types of items, don't propagate enter to iron-list's listener.
- if (event.key == 'Enter')
- event.stopPropagation();
- },
-
- /**
- * When clicking on a row, do not show focus outline if the element wasn't
- * already in focus.
- * @private
- */
- onMouseDown_: function() {
- if (!this.focusedByKey_)
- this.classList.add('no-outline');
- },
-
- /**
- * Reset when moving away from the row entirely.
- * @private
- */
- onBlur_: function() {
- this.classList.remove('no-outline');
- this.focusedByKey_ = false;
- },
-};

Powered by Google App Engine
This is Rietveld 408576698