| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Object} | 7 * @extends {WebInspector.Object} |
| 8 * @param {!Element} element | 8 * @param {!Element} element |
| 9 */ | 9 */ |
| 10 WebInspector.DropDownMenu = function(element) | 10 WebInspector.DropDownMenu = function(element) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 WebInspector.DropDownMenu.Events = { | 22 WebInspector.DropDownMenu.Events = { |
| 23 ItemSelected: "ItemSelected" | 23 ItemSelected: "ItemSelected" |
| 24 } | 24 } |
| 25 | 25 |
| 26 WebInspector.DropDownMenu.prototype = { | 26 WebInspector.DropDownMenu.prototype = { |
| 27 /** | 27 /** |
| 28 * @param {!Event} event | 28 * @param {!Event} event |
| 29 */ | 29 */ |
| 30 _onMouseDown: function(event) | 30 _onMouseDown: function(event) |
| 31 { | 31 { |
| 32 if (event.which !== 1) |
| 33 return; |
| 32 var menu = new WebInspector.ContextMenu(event); | 34 var menu = new WebInspector.ContextMenu(event); |
| 33 for (var item of this._items) | 35 for (var item of this._items) |
| 34 menu.appendCheckboxItem(item.title, this._itemHandler.bind(this, ite
m.id), item.id === this._selectedItemId); | 36 menu.appendCheckboxItem(item.title, this._itemHandler.bind(this, ite
m.id), item.id === this._selectedItemId); |
| 35 menu.show(); | 37 menu.show(); |
| 36 }, | 38 }, |
| 37 | 39 |
| 38 /** | 40 /** |
| 39 * @param {string} id | 41 * @param {string} id |
| 40 */ | 42 */ |
| 41 _itemHandler: function(id) | 43 _itemHandler: function(id) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 61 }, | 63 }, |
| 62 | 64 |
| 63 clear: function() | 65 clear: function() |
| 64 { | 66 { |
| 65 this._items = []; | 67 this._items = []; |
| 66 delete this._selectedItemId; | 68 delete this._selectedItemId; |
| 67 }, | 69 }, |
| 68 | 70 |
| 69 __proto__: WebInspector.Object.prototype | 71 __proto__: WebInspector.Object.prototype |
| 70 } | 72 } |
| OLD | NEW |