Chromium Code Reviews| Index: ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js |
| diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js |
| index 9f58dc4f6cd9079f59c2ee05364b0f1f5aef5e46..8e82b3dff53ce14fe06b6863e58fc2e42d30cc40 100644 |
| --- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js |
| +++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js |
| @@ -32,6 +32,7 @@ Polymer({ |
| listeners: { |
| 'keydown': 'onKeyDown_', |
| + 'mousemove': 'onMouseMove_', |
| 'tap': 'onTap_', |
| }, |
| @@ -83,6 +84,25 @@ Polymer({ |
| e.preventDefault(); |
| }, |
| + debounceFlusher_: null, |
| + |
| + onMouseMove_: function(e) { |
| + var target = e.target; |
| + |
| + if(!this.debounceFlusher_) { |
|
scottchen
2017/04/04 20:43:12
Need this, otherwise if the user keeps moving thei
|
| + this.debounceFlusher_ = setTimeout(function(){ |
| + this.flushDebouncer('cr-action-menu-mousemove'); |
| + this.debounceFlusher_ = null; |
| + }.bind(this), 10); |
| + } |
| + |
| + this.debounce('cr-action-menu-mousemove', function(){ |
| + if(target.classList.contains('dropdown-item') && |
| + target != document.activeElement) |
| + target.focus(); |
| + }.bind(this), 10); |
| + }, |
| + |
| /** |
| * @param {number} step -1 for getting previous option (up), 1 for getting |
| * next option (down). |