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

Side by Side Diff: Source/devtools/front_end/elements/ElementsPanel.js

Issue 649633005: DevTools: fix nowrap style in the elements panel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh anged, this._updateTreeOutlineVisibleWidth.bind(this)); 43 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh anged, this._updateTreeOutlineVisibleWidth.bind(this));
44 this._splitView.show(this.element); 44 this._splitView.show(this.element);
45 45
46 this._searchableView = new WebInspector.SearchableView(this); 46 this._searchableView = new WebInspector.SearchableView(this);
47 this._searchableView.setMinimumSize(25, 19); 47 this._searchableView.setMinimumSize(25, 19);
48 this._searchableView.show(this._splitView.mainElement()); 48 this._searchableView.show(this._splitView.mainElement());
49 var stackElement = this._searchableView.element; 49 var stackElement = this._searchableView.element;
50 50
51 this.contentElement = stackElement.createChild("div"); 51 this.contentElement = stackElement.createChild("div");
52 this.contentElement.id = "elements-content"; 52 this.contentElement.id = "elements-content";
53 if (!WebInspector.settings.domWordWrap.get()) 53 // FIXME: crbug.com/425984
54 this.contentElement.classList.add("nowrap"); 54 if (WebInspector.settings.domWordWrap.get())
55 this.contentElement.classList.add("elements-wrap");
55 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting Changed.bind(this)); 56 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting Changed.bind(this));
56 57
57 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb arContextMenuEventFired.bind(this), false); 58 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb arContextMenuEventFired.bind(this), false);
58 59
59 var crumbsContainer = stackElement.createChild("div"); 60 var crumbsContainer = stackElement.createChild("div");
60 crumbsContainer.id = "elements-crumbs"; 61 crumbsContainer.id = "elements-crumbs";
61 this.crumbsElement = crumbsContainer.createChild("div", "crumbs"); 62 this.crumbsElement = crumbsContainer.createChild("div", "crumbs");
62 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi nd(this), false); 63 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi nd(this), false);
63 this.crumbsElement.addEventListener("mouseleave", this._mouseMovedOutOfCrumb s.bind(this), false); 64 this.crumbsElement.addEventListener("mouseleave", this._mouseMovedOutOfCrumb s.bind(this), false);
64 65
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 for (var i = 0; i < this._treeOutlines.length; ++i) 123 for (var i = 0; i < this._treeOutlines.length; ++i)
123 this._treeOutlines[i].setPickNodeMode(false); 124 this._treeOutlines[i].setPickNodeMode(false);
124 }, 125 },
125 126
126 /** 127 /**
127 * @param {!WebInspector.Target} target 128 * @param {!WebInspector.Target} target
128 */ 129 */
129 targetAdded: function(target) 130 targetAdded: function(target)
130 { 131 {
131 var treeOutline = new WebInspector.ElementsTreeOutline(target, true, tru e, this._setPseudoClassForNode.bind(this)); 132 var treeOutline = new WebInspector.ElementsTreeOutline(target, true, tru e, this._setPseudoClassForNode.bind(this));
133 treeOutline.setWordWrap(WebInspector.settings.domWordWrap.get());
132 treeOutline.wireToDOMModel(); 134 treeOutline.wireToDOMModel();
133 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Sel ectedNodeChanged, this._selectedNodeChanged, this); 135 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Sel ectedNodeChanged, this._selectedNodeChanged, this);
134 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Nod ePicked, this._onNodePicked, this); 136 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Nod ePicked, this._onNodePicked, this);
135 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Ele mentsTreeUpdated, this._updateBreadcrumbIfNeeded, this); 137 treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.Ele mentsTreeUpdated, this._updateBreadcrumbIfNeeded, this);
136 this._treeOutlines.push(treeOutline); 138 this._treeOutlines.push(treeOutline);
137 this._targetToTreeOutline.set(target, treeOutline); 139 this._targetToTreeOutline.set(target, treeOutline);
138 140
139 // Perform attach if necessary. 141 // Perform attach if necessary.
140 if (this.isShowing()) 142 if (this.isShowing())
141 this.wasShown(); 143 this.wasShown();
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 return; 438 return;
437 this._currentSearchResultIndex = -1; 439 this._currentSearchResultIndex = -1;
438 440
439 if (shouldJump) 441 if (shouldJump)
440 this._jumpToSearchResult(jumpBackwards ? -1 : 0); 442 this._jumpToSearchResult(jumpBackwards ? -1 : 0);
441 } 443 }
442 }, 444 },
443 445
444 _domWordWrapSettingChanged: function(event) 446 _domWordWrapSettingChanged: function(event)
445 { 447 {
446 if (event.data) 448 // FIXME: crbug.com/425984
447 this.contentElement.classList.remove("nowrap"); 449 this.contentElement.classList.toggle("elements-wrap", event.data);
448 else 450 for (var i = 0; i < this._treeOutlines.length; ++i)
449 this.contentElement.classList.add("nowrap"); 451 this._treeOutlines[i].setWordWrap(/** @type {boolean} */ (event.data ));
450 452
451 var selectedNode = this.selectedDOMNode(); 453 var selectedNode = this.selectedDOMNode();
452 if (!selectedNode) 454 if (!selectedNode)
453 return; 455 return;
454 456
455 var treeElement = this._treeElementForNode(selectedNode); 457 var treeElement = this._treeElementForNode(selectedNode);
456 if (treeElement) 458 if (treeElement)
457 treeElement.updateSelection(); // Recalculate selection highlight di mensions. 459 treeElement.updateSelection(); // Recalculate selection highlight di mensions.
458 }, 460 },
459 461
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 1570
1569 WebInspector.ElementsPanelFactory.prototype = { 1571 WebInspector.ElementsPanelFactory.prototype = {
1570 /** 1572 /**
1571 * @return {!WebInspector.Panel} 1573 * @return {!WebInspector.Panel}
1572 */ 1574 */
1573 createPanel: function() 1575 createPanel: function()
1574 { 1576 {
1575 return WebInspector.ElementsPanel.instance(); 1577 return WebInspector.ElementsPanel.instance();
1576 } 1578 }
1577 } 1579 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/common/Settings.js ('k') | Source/devtools/front_end/elements/ElementsTreeOutline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698