Chromium Code Reviews| Index: chrome/browser/resources/settings/list_item_behavior.js |
| diff --git a/chrome/browser/resources/settings/list_item_behavior.js b/chrome/browser/resources/settings/list_item_behavior.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2024db82d5eb1b1f27ec7043e767fb26b64a20a5 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/list_item_behavior.js |
| @@ -0,0 +1,22 @@ |
| +// Copyright 2016 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. |
| + |
| +/** |
| + * The max z index assigned to an <iron-list> item so far. Used to |
| + * ensure that the per-item popup menu is displayed correctly. |
| + * @private {number} |
| + */ |
| +var maxZIndex_ = 0; |
| + |
| +/** @polymerBehavior */ |
| +var ListItemBehavior = { |
| + showActionMenu: function() { |
|
Dan Beam
2016/09/27 23:02:04
this really doesn't show any action menu. it real
dpapad
2016/09/28 00:13:35
Renamed.
|
| + // <iron-list> applies translate3d() transform on every element, which |
| + // means that in the natural order the (n-1)-th element is at a lower z |
| + // index than the n-th element. This prevents the popup menu from being |
| + // painted on top of other elements, and therefore a zIndex adjustment is |
| + // necessary. |
| + this.style.zIndex = ++maxZIndex_; |
| + }, |
| +}; |
|
Dan Beam
2016/09/27 23:02:04
can we make this static and private?
ListItemBeha
dpapad
2016/09/28 00:13:35
Already responded to Steven's similar question. Tr
Dan Beam
2016/09/28 01:32:07
I can see how this would look a little confusing.
dpapad
2016/09/28 01:50:32
Done. Thanks for the clarification. I misunderstoo
|