Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/devtools/front_end/ui/DropDownMenu.js

Issue 1180013005: [DevTools] Show DropDownMenu for left mouse button only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698