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

Side by Side Diff: Source/devtools/front_end/network/NetworkPanel.js

Issue 634543002: DevTools: NetworkPanel: update hovered row labels when graph is updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« 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 /* 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, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
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 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 2710
2711 this._barRightElement = this._barAreaElement.createChild("div", "network -graph-bar"); 2711 this._barRightElement = this._barAreaElement.createChild("div", "network -graph-bar");
2712 this._barRightElement.classList.add(type); 2712 this._barRightElement.classList.add(type);
2713 this._barRightElement.classList.toggle("cached", cached); 2713 this._barRightElement.classList.toggle("cached", cached);
2714 2714
2715 this._labelLeftElement = this._barAreaElement.createChild("div", "networ k-graph-label"); 2715 this._labelLeftElement = this._barAreaElement.createChild("div", "networ k-graph-label");
2716 this._labelLeftElement.classList.add("waiting"); 2716 this._labelLeftElement.classList.add("waiting");
2717 2717
2718 this._labelRightElement = this._barAreaElement.createChild("div", "netwo rk-graph-label"); 2718 this._labelRightElement = this._barAreaElement.createChild("div", "netwo rk-graph-label");
2719 2719
2720 cell.addEventListener("mouseover", this._refreshLabelPositions.bind(this ), false); 2720 cell.addEventListener("mouseover", this._onMouseOver.bind(this), false);
2721 }, 2721 },
2722 2722
2723 /** 2723 /**
2724 * @param {!Event} event
2725 */
2726 _onMouseOver: function(event)
2727 {
2728 this._refreshLabelPositions();
2729 this._parentView.__hoveredRow = this;
vsevik 2014/10/14 06:48:08 Let's use Symbol
eustas 2014/10/14 08:17:47 Done.
2730 },
2731
2732 /**
2724 * @return {boolean} 2733 * @return {boolean}
2725 */ 2734 */
2726 _isFailed: function() 2735 _isFailed: function()
2727 { 2736 {
2728 return (this._request.failed && !this._request.statusCode) || (this._req uest.statusCode >= 400); 2737 return (this._request.failed && !this._request.statusCode) || (this._req uest.statusCode >= 400);
2729 }, 2738 },
2730 2739
2731 /** 2740 /**
2732 * @param {!Element} cell 2741 * @param {!Element} cell
2733 */ 2742 */
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 2909
2901 var labels = calculator.computeBarGraphLabels(this._request); 2910 var labels = calculator.computeBarGraphLabels(this._request);
2902 this._labelLeftElement.textContent = labels.left; 2911 this._labelLeftElement.textContent = labels.left;
2903 this._labelRightElement.textContent = labels.right; 2912 this._labelRightElement.textContent = labels.right;
2904 2913
2905 var tooltip = (labels.tooltip || ""); 2914 var tooltip = (labels.tooltip || "");
2906 this._barLeftElement.title = tooltip; 2915 this._barLeftElement.title = tooltip;
2907 this._labelLeftElement.title = tooltip; 2916 this._labelLeftElement.title = tooltip;
2908 this._labelRightElement.title = tooltip; 2917 this._labelRightElement.title = tooltip;
2909 this._barRightElement.title = tooltip; 2918 this._barRightElement.title = tooltip;
2919
2920 if (this._parentView.__hoveredRow === this) {
2921 this._refreshLabelPositions();
2922 }
2910 }, 2923 },
2911 2924
2912 _refreshLabelPositions: function() 2925 _refreshLabelPositions: function()
2913 { 2926 {
2914 if (!this._percentages) 2927 if (!this._percentages)
2915 return; 2928 return;
2916 this._labelLeftElement.style.removeProperty("left"); 2929 this._labelLeftElement.style.removeProperty("left");
2917 this._labelLeftElement.style.removeProperty("right"); 2930 this._labelLeftElement.style.removeProperty("right");
2918 this._labelLeftElement.classList.remove("before"); 2931 this._labelLeftElement.classList.remove("before");
2919 this._labelLeftElement.classList.remove("hidden"); 2932 this._labelLeftElement.classList.remove("hidden");
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 3144
3132 WebInspector.NetworkPanelFactory.prototype = { 3145 WebInspector.NetworkPanelFactory.prototype = {
3133 /** 3146 /**
3134 * @return {!WebInspector.Panel} 3147 * @return {!WebInspector.Panel}
3135 */ 3148 */
3136 createPanel: function() 3149 createPanel: function()
3137 { 3150 {
3138 return WebInspector.NetworkPanel._instance(); 3151 return WebInspector.NetworkPanel._instance();
3139 } 3152 }
3140 } 3153 }
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