Dev: Touch visual effects

This commit is contained in:
surunzi
2016-05-29 09:43:19 +08:00
parent 166c792c20
commit e1a00e1af9
24 changed files with 192 additions and 71 deletions

View File

@@ -118,6 +118,8 @@ export default class Network extends Tool
target.time = target.time - target.startTime;
target.displayTime = formatTime(target.time);
if (target.done && (target.status < 200 || target >= 300)) target.hasErr = true;
this._render();
}
_bindEvent()
@@ -306,9 +308,9 @@ export default class Network extends Tool
var settings = this._parent.get('settings');
settings.text('Network')
.add(cfg, 'overrideXhr', 'Catch Xhr Requests')
.add(cfg, 'hideXhrResource', 'Hide Xhr Resource Timing')
.add(cfg, 'disablePerformance', 'Disable Performance Timing')
.switch(cfg, 'overrideXhr', 'Catch Xhr Requests')
.switch(cfg, 'hideXhrResource', 'Hide Xhr Resource Timing')
.switch(cfg, 'disablePerformance', 'Disable Performance Timing')
.separator();
}
_render()
@@ -319,7 +321,7 @@ export default class Network extends Tool
var renderData = {entries: this._resourceTimingData};
if (util.keys(this._requests).length > 0)
if (!util.isEmpty(this._requests))
{
renderData.requests = this._requests;
}

View File

@@ -45,7 +45,7 @@
{{#if requests}}
<ul class="eruda-requests">
{{#each requests}}
<li class="eruda-request" data-id="{{@key}}">
<li class="eruda-request {{#if hasErr}}eruda-error{{/if}}" data-id="{{@key}}">
<span>{{name}}</span>
<span>{{status}}</span>
<span>{{method}}</span>

View File

@@ -56,6 +56,11 @@
height: 41px;
-webkit-overflow-scrolling: touch;
white-space: nowrap;
&.error {
span {
color: $red;
}
}
span {
display: inline-block;
line-height: 40px;

View File

@@ -133,5 +133,7 @@ function fullUrl(url)
{
if (util.startWith(url, 'http')) return url;
if (!util.startWith(url, '/')) url = '/' + url;
return origin + url;
}