Permalink
Browse files

Issue 4662 (Incorrect sorting for timeline, if waterfall graph is

  • Loading branch information...
1 parent f58fabf commit aa164b57b3fce810a147e7aab83df6d28a2e9323 @SebastianZ SebastianZ committed with janodvarko Jul 23, 2012
Showing with 12 additions and 3 deletions.
  1. +4 −0 extension/content/firebug/net/netProgress.js
  2. +8 −3 extension/content/firebug/net/netReps.js
@@ -118,6 +118,8 @@ NetProgress.prototype =
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ requestNumber: 1,
+
startFile: function startFile(request, win)
{
var file = this.getRequestFile(request, win);
@@ -816,6 +818,8 @@ NetProgress.prototype =
}
file.request = request;
+ file.requestNumber = this.requestNumber;
+ this.requestNumber++;
this.requests.push(request);
this.files.push(file);
@@ -181,12 +181,16 @@ Firebug.NetMonitor.NetRequestTable = domplate(Firebug.Rep, new Firebug.Listener(
(direction == "asc" && header.sorted == -1))
return;
+ var newDirection = ((header.sorted && header.sorted == 1) || (!header.sorted && direction == "asc")) ? "ascending" : "descending";
if (header)
- header.setAttribute("aria-sort", header.sorted === -1 ? "descending" : "ascending");
+ header.setAttribute("aria-sort", newDirection);
var tbody = table.lastChild;
var colID = header.getAttribute("id");
+ table.setAttribute("sortcolumn", colID);
+ table.setAttribute("sortdirection", newDirection);
+
var values = [];
for (var row = tbody.childNodes[1]; row; row = row.nextSibling)
{
@@ -221,7 +225,8 @@ Firebug.NetMonitor.NetRequestTable = domplate(Firebug.Rep, new Firebug.Listener(
switch (colID)
{
case "netTimeCol":
- value = row.repObject.startTime;
+ FBTrace.sysout("row.repObject", row.repObject);
+ value = row.repObject.requestNumber;
break;
case "netSizeCol":
value = row.repObject.size;
@@ -249,7 +254,7 @@ Firebug.NetMonitor.NetRequestTable = domplate(Firebug.Rep, new Firebug.Listener(
values.sort(sortFunction);
- if ((header.sorted && header.sorted == 1) || (!header.sorted && direction == "asc"))
+ if (newDirection == "ascending")
{
Css.removeClass(header, "sortedDescending");
Css.setClass(header, "sortedAscending");

0 comments on commit aa164b5

Please sign in to comment.