Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| index cfc5efd13db88e8f10692ce1cf6437ecc63b37f7..70c374e8dcbc3ce3142f65ecb1f339cf698cd52d 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| @@ -644,6 +644,16 @@ WebInspector.ToolbarMenuButton.prototype = { |
| return; |
| } |
| + if (!this._triggerTimeout) |
| + this._triggerTimeout = setTimeout(this._trigger.bind(this, event), 200); |
| + }, |
| + |
| + /** |
| + * @param {!Event} event |
| + */ |
| + _trigger: function(event) |
| + { |
| + delete this._triggerTimeout; |
|
PhistucK
2016/03/16 18:04:48
As far as I know, delete foo; is discouraged becau
pfeldman
2016/03/16 19:33:31
This code path will never be optimized in the firs
|
| var contextMenu = new WebInspector.ContextMenu(event, |
| this._useSoftMenu, |
| this.element.totalOffsetLeft(), |
| @@ -658,6 +668,10 @@ WebInspector.ToolbarMenuButton.prototype = { |
| */ |
| _clicked: function(event) |
| { |
| + if (!this._triggerTimeout) |
| + return; |
| + clearTimeout(this._triggerTimeout); |
| + this._trigger(event); |
| }, |
| __proto__: WebInspector.ToolbarButton.prototype |