Dev: Collapse performance timing

This commit is contained in:
surunzi
2016-05-10 19:58:04 +08:00
parent 97ab447401
commit 1ec7c8b388
3 changed files with 32 additions and 2 deletions

View File

@@ -13,12 +13,28 @@ export default class Network extends Tool
this._tpl = require('./Network.hbs');
}
init($el)
{
super.init($el);
this._bindEvent();
}
show()
{
super.show();
this._getPerformanceTimingData();
}
_bindEvent()
{
var $el = this._$el;
$el.on('click', '.eruda-expand', function ()
{
util.$(this).hide();
$el.find('.eruda-performance-timing-detail').show();
});
}
_getPerformanceTimingData()
{
var performance = window.webkitPerformance || window.performance,

View File

@@ -9,7 +9,8 @@
</div>
<div class="eruda-performance-timing-data">
<table>
<div class="eruda-expand">Expand</div>
<table class="eruda-performance-timing-detail">
<thead>
<tr>
<th>Name</th>

View File

@@ -28,11 +28,24 @@
}
.performance-timing-data {
padding: 0 10px 10px;
text-align: center;
.expand {
display: inline-block;
background: #fff;
border: 1px solid $blue;
width: 150px;
height: 30px;
font-size: 12px;
line-height: 30px;
box-shadow: $box-shadow;
margin: 0 auto;
}
table {
width: 100%;
display: none;
background: #fff;
border-collapse: collapse;
text-align: left;
th {
background: $gray;
text-align: left;