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.HBox} | 7 * @extends {WebInspector.HBox} |
8 */ | 8 */ |
9 WebInspector.ElementsBreadcrumbs = function() | 9 WebInspector.ElementsBreadcrumbs = function() |
10 { | 10 { |
11 WebInspector.HBox.call(this, true); | 11 WebInspector.HBox.call(this, true); |
12 this.registerRequiredCSS("elements/breadcrumbs.css"); | 12 this.registerRequiredCSS("elements/breadcrumbs.css"); |
13 | 13 |
14 this.crumbsElement = this.contentElement.createChild("div", "crumbs"); | 14 this.crumbsElement = this.contentElement.createChild("div", "crumbs"); |
15 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); | 15 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); |
16 this.crumbsElement.addEventListener("mouseleave", this._mouseMovedOutOfCrumb
s.bind(this), false); | 16 this.crumbsElement.addEventListener("mouseleave", this._mouseMovedOutOfCrumb
s.bind(this), false); |
17 this._nodeSymbol = Symbol("node"); | 17 this._nodeSymbol = Symbol("node"); |
18 }; | 18 }; |
19 | 19 |
20 /** @enum {symbol} */ | 20 /** @enum {symbol} */ |
21 WebInspector.ElementsBreadcrumbs.Events = { | 21 WebInspector.ElementsBreadcrumbs.Events = { |
22 NodeSelected: Symbol("NodeSelected") | 22 NodeSelected: Symbol("NodeSelected") |
23 }; | 23 }; |
24 | 24 |
25 WebInspector.ElementsBreadcrumbs.prototype = { | 25 WebInspector.ElementsBreadcrumbs.prototype = { |
| 26 /** |
| 27 * @override |
| 28 */ |
26 wasShown: function() | 29 wasShown: function() |
27 { | 30 { |
28 this.update(); | 31 this.update(); |
29 }, | 32 }, |
30 | 33 |
31 /** | 34 /** |
32 * @param {!Array.<!WebInspector.DOMNode>} nodes | 35 * @param {!Array.<!WebInspector.DOMNode>} nodes |
33 */ | 36 */ |
34 updateNodes: function(nodes) | 37 updateNodes: function(nodes) |
35 { | 38 { |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 compact(selectedCrumb); | 430 compact(selectedCrumb); |
428 if (crumbsAreSmallerThanContainer()) | 431 if (crumbsAreSmallerThanContainer()) |
429 return; | 432 return; |
430 | 433 |
431 // Collapse the selected crumb as a last resort. Pass true to prevent co
alescing. | 434 // Collapse the selected crumb as a last resort. Pass true to prevent co
alescing. |
432 collapse(selectedCrumb, true); | 435 collapse(selectedCrumb, true); |
433 }, | 436 }, |
434 | 437 |
435 __proto__: WebInspector.HBox.prototype | 438 __proto__: WebInspector.HBox.prototype |
436 }; | 439 }; |
OLD | NEW |