Skip to content

Commit acfe12a

Browse files
author
Daniel Herzog
committed
Don't line-break in raw mode, switch to scroll the container when URL is really long
1 parent fa73dc0 commit acfe12a

File tree

3 files changed

+49
-8
lines changed

3 files changed

+49
-8
lines changed

src/network/network_details_templates.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ templates.details = function(entry, left_val, do_raw)
5959
"class", "height-holder"
6060
]
6161
],
62-
"class", "network-details-container",
62+
"class", "network-details-container" + (do_raw? "" : " parsed"),
6363
"style", "left:" + left_val + "px"]
6464
);
6565
};
@@ -415,7 +415,6 @@ templates._request_body = function(req, do_raw)
415415
}
416416
}
417417
}
418-
419418
return ret;
420419
};
421420

src/network/network_style.css

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@
273273
-1px 0 0 rgba(0, 0, 0, 0.05);
274274
}
275275

276+
.network-details-container-overflows
277+
{
278+
overflow: auto;
279+
}
280+
276281
.network_logger .entry-details
277282
{
278283
overflow: auto;
@@ -281,6 +286,16 @@
281286
box-sizing: border-box;
282287
}
283288

289+
.network-details-container-overflows .entry-details,
290+
.network-details-container-overflows .network-details-header-row,
291+
.network-details-container-overflows .height-holder
292+
{
293+
overflow: visible;
294+
height: auto;
295+
position: static;
296+
padding-top: 0;
297+
}
298+
284299
.height-holder /* todo: probably merge me with entry-details */
285300
{
286301
height: 100%;
@@ -297,7 +312,11 @@
297312
z-index: 3;
298313
width: 100%;
299314
box-sizing: border-box;
300-
padding: 10px;
315+
padding: 5px;
316+
padding-right: 45px;
317+
height: 55px;
318+
overflow: auto;
319+
border-bottom: 1px solid #D6D6D6;
301320
}
302321

303322
.network-details-header-row > p
@@ -308,6 +327,7 @@
308327

309328
.network-details-header-row .method-and-url
310329
{
330+
white-space: pre;
311331
word-wrap: break-word;
312332
}
313333

@@ -338,9 +358,12 @@
338358
.network-details-container p
339359
{
340360
margin: 0;
341-
/*
361+
}
362+
.parsed pre,
363+
.parsed p,
364+
.parsed td
365+
{
342366
word-wrap: break-word;
343-
*/
344367
}
345368

346369
.network-details-container table
@@ -353,9 +376,6 @@
353376
{
354377
padding: 0;
355378
vertical-align: top;
356-
/*
357-
word-wrap: break-word;
358-
*/
359379
}
360380

361381
.network-details-container th

src/network/network_view.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ cls.NetworkLogView = function(id, name, container_class, html, default_handler,
201201

202202
if (this._details_scroll_left)
203203
details.scrollLeft = this._details_scroll_left;
204+
205+
this.check_overflow();
204206
}
205207

206208
if (is_data_mode)
@@ -220,6 +222,25 @@ cls.NetworkLogView = function(id, name, container_class, html, default_handler,
220222
}
221223
}.bind(this);
222224

225+
this.check_overflow = function()
226+
{
227+
var header_row = this._container.querySelector(".network-details-header-row");
228+
var details_container = this._container.querySelector(".network-details-container");
229+
if (!header_row || !details_container)
230+
return;
231+
232+
if (!this._header_row_height)
233+
{
234+
var style_dec = document.styleSheets.getDeclaration(".network-details-header-row");
235+
this._header_row_height = parseInt(style_dec.getPropertyValue("height"), 10); // in px
236+
}
237+
// Switch the overflow to .network-details-container (or back, in case of resizing)
238+
if (header_row.scrollHeight > this._header_row_height)
239+
details_container.addClass("network-details-container-overflows");
240+
else
241+
details_container.removeClass("network-details-container-overflows");
242+
}
243+
223244
this._tabledef = {
224245
column_order: ["method", "responsecode", "mime", "protocol", "size_h", "waiting", "duration", "started", "graph"],
225246
handler: "select-network-request",
@@ -357,6 +378,7 @@ cls.NetworkLogView = function(id, name, container_class, html, default_handler,
357378
this._detail_left = Math.min(this._detail_left, window.innerWidth - 100);
358379
container.style.left = this._detail_left + "px";
359380
settings.network_logger.set("detail-view-left-pos", this._detail_left);
381+
this.check_overflow();
360382
}
361383
}.bind(this);
362384

0 commit comments

Comments
 (0)