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 */ | 8 */ |
9 WebInspector.DropDownMenu = function() | 9 WebInspector.DropDownMenu = function() |
10 { | 10 { |
11 this.element = document.createElementWithClass("select", "drop-down-menu"); | 11 this.element = createElementWithClass("select", "drop-down-menu"); |
12 this.element.addEventListener("mousedown", this._onBeforeMouseDown.bind(this
), true); | 12 this.element.addEventListener("mousedown", this._onBeforeMouseDown.bind(this
), true); |
13 this.element.addEventListener("mousedown", consumeEvent, false); | 13 this.element.addEventListener("mousedown", consumeEvent, false); |
14 this.element.addEventListener("change", this._onChange.bind(this), false); | 14 this.element.addEventListener("change", this._onChange.bind(this), false); |
15 } | 15 } |
16 | 16 |
17 WebInspector.DropDownMenu.Events = { | 17 WebInspector.DropDownMenu.Events = { |
18 BeforeShow: "BeforeShow", | 18 BeforeShow: "BeforeShow", |
19 ItemSelected: "ItemSelected" | 19 ItemSelected: "ItemSelected" |
20 } | 20 } |
21 | 21 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 this.element.selectedIndex = -1; | 59 this.element.selectedIndex = -1; |
60 }, | 60 }, |
61 | 61 |
62 clear: function() | 62 clear: function() |
63 { | 63 { |
64 this.element.removeChildren(); | 64 this.element.removeChildren(); |
65 }, | 65 }, |
66 | 66 |
67 __proto__: WebInspector.Object.prototype | 67 __proto__: WebInspector.Object.prototype |
68 } | 68 } |
OLD | NEW |