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..3859dd57257a4d66da51422d756b31656ad25c24 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; |
| var contextMenu = new WebInspector.ContextMenu(event, |
| this._useSoftMenu, |
| this.element.totalOffsetLeft(), |
| @@ -658,6 +668,11 @@ WebInspector.ToolbarMenuButton.prototype = { |
| */ |
| _clicked: function(event) |
| { |
| + if (this._triggerTimeout) { |
|
caseq
2016/03/16 00:12:00
nit:
if (!this._triggerTimeout)
return;
dgozman
2016/03/16 01:54:13
Done.
|
| + clearTimeout(this._triggerTimeout); |
| + delete this._triggerTimeout; |
|
caseq
2016/03/16 00:12:00
this is redundant.
dgozman
2016/03/16 01:54:12
Done.
|
| + this._trigger(event); |
| + } |
| }, |
| __proto__: WebInspector.ToolbarButton.prototype |